X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/483162a72bfe820b11db05c384c0fc6103d084cf..c76406e46e71cb86cfb440667bfbbe21b36e709e:/forum/forms/admin.py diff --git a/forum/forms/admin.py b/forum/forms/admin.py index 7bf789e..32d710b 100644 --- a/forum/forms/admin.py +++ b/forum/forms/admin.py @@ -1,9 +1,11 @@ import socket from django import forms from django.utils.translation import ugettext as _ +from django.contrib.admin.widgets import FilteredSelectMultiple, AdminDateWidget from qanda import TitleField, EditorField from forum import settings from forum.models.node import NodeMetaClass +from forum.models import User class IPListField(forms.CharField): def clean(self, value): @@ -103,14 +105,17 @@ class NodeManFilterForm(forms.Form): text_in = forms.ChoiceField(required=False, widget=forms.RadioSelect, choices=TEXT_IN_CHOICES, initial='title') -NODE_SHOW_CHOICES = ( -('score', _('Score')), -('added_at', 'Added at'), -('last_activity_at', 'Last activity at'), -('last_activity_by', 'Last activity by') -) +from forum.forms.auth import SimpleRegistrationForm +from forum.forms.general import SetPasswordForm + + +class CreateUserForm(SimpleRegistrationForm, SetPasswordForm): + validate_email = forms.BooleanField(required=False, label=_('send validation email')) + + def __init__(self, *args, **kwargs): + super(CreateUserForm, self).__init__(*args, **kwargs) + self.fields.keyOrder = ['username', 'email', 'validate_email', 'password1', 'password2'] + self.fields['email'].label = _('email address') -class NodeManShowForm(forms.Form): - show = forms.MultipleChoiceField(choices=NODE_SHOW_CHOICES, widget=forms.CheckboxSelectMultiple) \ No newline at end of file