Permalink
Browse files

Bugfix: Registering need a unique email address

  • Loading branch information...
jedie committed Oct 22, 2012
1 parent bf983ce commit 80e1d69749238aba66889e267ac8319ba06df689
Showing with 8 additions and 13 deletions.
  1. +0 −12 basic_project/forms.py
  2. +8 −1 basic_project/urls.py
View
@@ -1,12 +0,0 @@
-import re
-from registration.forms import RegistrationFormUniqueEmail
-
-
-class RegistrationFormUtfUsername(RegistrationFormUniqueEmail):
- '''
- Allowed UTF8 logins with space
- '''
- def __init__(self, *args, **kwargs):
- super(RegistrationFormUtfUsername, self).__init__(*args, **kwargs)
- self.fields['username'].regex = re.compile(r"^[\w\s-]+$", re.UNICODE)
-
View
@@ -7,10 +7,17 @@
from django.contrib import admin
from djangobb_forum import settings as forum_settings
-from forms import RegistrationFormUtfUsername
from sitemap import SitemapForum, SitemapTopic
+# HACK for add default_params with RegistrationFormUniqueEmail to registration urlpattern
+# So registration only works with a unique email address
+from django_authopenid.urls import urlpatterns as authopenid_urlpatterns
+from registration.forms import RegistrationFormUniqueEmail
+for i, rurl in enumerate(authopenid_urlpatterns):
+ if rurl.name == 'registration_register':
+ authopenid_urlpatterns[i].default_args.update({'form_class': RegistrationFormUniqueEmail})
+
admin.autodiscover()

0 comments on commit 80e1d69

Please sign in to comment.