Commits

Pedro Beck committed 8f92872

Django 1.6 compatibility fix. Auth views' redirects are explicitly specified now.
Send user_activated signal when activating users from the admin site.

  • Participants
  • Parent commits f16d841

Comments (0)

Files changed (2)

File registration/admin.py

 from django.utils.translation import ugettext_lazy as _
 
 from registration.models import RegistrationProfile
+from registration.signals import user_activated
 
 
 class RegistrationAdmin(admin.ModelAdmin):
         """
         for profile in queryset:
             RegistrationProfile.objects.activate_user(profile.activation_key)
+            activated = RegistrationProfile.objects.activate_user(profile.activation_key)
+            if activated:
+                user_activated.send(
+                    sender=self.__class__,
+                    user=activated,
+                    request=request
+                )
+
     activate_users.short_description = _("Activate users")
 
     def resend_activation_email(self, request, queryset):

File registration/auth_urls.py

 from django.conf.urls import include
 from django.conf.urls import patterns
 from django.conf.urls import url
+from django.core.urlresolvers import reverse_lazy
 
 from django.contrib.auth import views as auth_views
 
                            name='auth_logout'),
                        url(r'^password/change/$',
                            auth_views.password_change,
+                           {'post_change_redirect': reverse_lazy('auth_password_change_done')},
                            name='auth_password_change'),
                        url(r'^password/change/done/$',
                            auth_views.password_change_done,
                            name='auth_password_change_done'),
                        url(r'^password/reset/$',
                            auth_views.password_reset,
+                           {'post_reset_redirect': reverse_lazy('auth_password_reset_done')},
                            name='auth_password_reset'),
-                       url(r'^password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
+                       url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
                            auth_views.password_reset_confirm,
+                           {'post_reset_redirect': reverse_lazy('auth_password_reset_complete')},
                            name='auth_password_reset_confirm'),
                        url(r'^password/reset/complete/$',
                            auth_views.password_reset_complete,