]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/localauth/views.py
fixes problem with always showing alert dialog in chrome. Still working out non...
[osqa.git] / forum_modules / localauth / views.py
index f0b4438a3fafa6d2939e5404986de9b18f818492..e1daff3e7b87b8bb551a36207ed21743ec869596 100644 (file)
@@ -4,8 +4,9 @@ from django.template import RequestContext
 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, send_validation_email
+from forum.forms import SimpleEmailSubscribeForm
+from forum.views.auth import login_and_forward
+from forum.actions import UserJoinsAction
 
 def register(request):
     if request.method == 'POST':
@@ -22,20 +23,21 @@ def register(request):
 
             if User.objects.all().count() == 0:
                 user_.is_superuser = True
+                user_.is_staff = True
 
             user_.save()
-            
-            send_validation_email(user_)
+            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 validation email has been sent to your email address. "))
+            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/signup.html', {
-        'form': form,
+    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