]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/forms/admin.py
Several improvements in the node bulk management feature. Improved filters and added...
[osqa.git] / forum / forms / admin.py
index 00dc3369106e524b3f3d211e3aa06990a67cc0bf..32d710bebc0a1f6d1f43a896a15c2065b9ae712c 100644 (file)
@@ -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):
@@ -100,6 +102,20 @@ class NodeManFilterForm(forms.Form):
     node_type = forms.CharField(widget=forms.HiddenInput, initial='all')
     state_type = forms.CharField(widget=forms.HiddenInput, initial='any')
     text = forms.CharField(required=False, widget=forms.TextInput(attrs={'size': 40}))
-    text_in = forms.ChoiceField(widget=forms.RadioSelect, choices=TEXT_IN_CHOICES, initial='title')
+    text_in = forms.ChoiceField(required=False, widget=forms.RadioSelect, choices=TEXT_IN_CHOICES, initial='title')
+
+
+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')
+
 
     
\ No newline at end of file