]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/localauth/views.py
make user subscriptions view decoratable
[osqa.git] / forum_modules / localauth / views.py
index 6416feea555affde9901ebddad2dce921ab7ff31..2fcee22198794ccaa1a7e14b3e29dd1c75ed2936 100644 (file)
@@ -4,16 +4,14 @@ from django.template import RequestContext
 from django.utils.translation import ugettext as _
 
 from forms import ClassicRegisterForm
 from django.utils.translation import ugettext as _
 
 from forms import ClassicRegisterForm
-from forum.authentication.forms import SimpleEmailSubscribeForm
 from forum.views.auth import login_and_forward
 from forum.actions import UserJoinsAction
 
 def register(request):
     if request.method == 'POST':
         form = ClassicRegisterForm(request.POST)
 from forum.views.auth import login_and_forward
 from forum.actions import UserJoinsAction
 
 def register(request):
     if request.method == 'POST':
         form = ClassicRegisterForm(request.POST)
-        email_feeds_form = SimpleEmailSubscribeForm(request.POST)
 
 
-        if form.is_valid() and email_feeds_form.is_valid():
+        if form.is_valid():
             username = form.cleaned_data['username']
             password = form.cleaned_data['password1']
             email = form.cleaned_data['email']
             username = form.cleaned_data['username']
             password = form.cleaned_data['password1']
             email = form.cleaned_data['email']
@@ -23,20 +21,15 @@ def register(request):
 
             if User.objects.all().count() == 0:
                 user_.is_superuser = True
 
             if User.objects.all().count() == 0:
                 user_.is_superuser = True
+                user_.is_staff = True
 
             user_.save()
             UserJoinsAction(user=user_, ip=request.META['REMOTE_ADDR']).save()
 
 
             user_.save()
             UserJoinsAction(user=user_, ip=request.META['REMOTE_ADDR']).save()
 
-            if email_feeds_form.cleaned_data['subscribe'] == 'n':
-                user_.subscription_settings.enable_notifications = False
-                user_.subscription_settings.save()
-
             return login_and_forward(request, user_, None, _("A welcome email has been sent to your email address. "))
     else:
         form = ClassicRegisterForm(initial={'next':'/'})
             return login_and_forward(request, user_, None, _("A welcome email has been sent to your email address. "))
     else:
         form = ClassicRegisterForm(initial={'next':'/'})
-        email_feeds_form = SimpleEmailSubscribeForm()
 
     return render_to_response('auth/complete.html', {
 
     return render_to_response('auth/complete.html', {
-        'form1': form,
-        'email_feeds_form': email_feeds_form
-        }, context_instance=RequestContext(request))
\ No newline at end of file
+        'form1': form
+        }, context_instance=RequestContext(request))