diff --git a/organize/browser.py b/organize/browser.py index d6ebf63..d962152 100644 --- a/organize/browser.py +++ b/organize/browser.py @@ -64,17 +64,17 @@ class MyStuff(ConceptView): return self -class PasswordWidget(BasePasswordWidget): - - def getInputValue(self): - value = super(PasswordWidget, self).getInputValue() - confirm = self.request.get('form.passwordConfirm') - if confirm != value: - v = _(u'Password and password confirmation do not match.') - self._error = WidgetInputError( - self.context.__name__, self.label, v) - raise self._error - return value +#class PasswordWidget(BasePasswordWidget): +# +# def getInputValue(self): +# value = super(PasswordWidget, self).getInputValue() +# confirm = self.request.get('form.passwordConfirm') +# if confirm != value: +# v = _(u'Password and password confirmation do not match.') +# self._error = WidgetInputError( +# self.context.__name__, self.label, v) +# raise self._error +# return value class MemberRegistration(NodeView, CreateForm): @@ -100,8 +100,8 @@ class MemberRegistration(NodeView, CreateForm): @Lazy def schema(self): schema = super(MemberRegistration, self).schema - if 'birthDate' in schema.fields: - del schema.fields['birthDate'] + schema.fields.remove('birthDate') + schema.fields.reorder(-2, 'loginName') return schema @Lazy diff --git a/schema.py b/schema.py index a30b9d3..4e2842d 100644 --- a/schema.py +++ b/schema.py @@ -44,9 +44,8 @@ class FileSchemaFactory(SchemaFactory): def __call__(self, interface, **kw): schema = super(FileSchemaFactory, self).__call__(interface, **kw) - if ('request' in kw and kw['request'].principal.id != 'rootadmin' - and 'contentType' in schema.fields.keys()): - del schema.fields['contentType'] + if 'request' in kw and kw['request'].principal.id != 'rootadmin': + schema.fields.remove('contentType') return schema @@ -56,8 +55,7 @@ class NoteSchemaFactory(SchemaFactory): def __call__(self, interface, **kw): schema = super(NoteSchemaFactory, self).__call__(interface, **kw) - del schema.fields['description'] + schema.fields.remove('description') schema.fields.data.height = 5 return schema -