File: send_signal_only_once_when_activating_user.patch

package info (click to toggle)
python-django-registration 1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 704 kB
  • ctags: 306
  • sloc: python: 876; makefile: 84
file content (28 lines) | stat: -rw-r--r-- 1,234 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Description: Fixes double signal sending when activating user.
 The patch can't be submitted upstream as there's no clear upstream
 maintainer currently.
Origin: other, https://bitbucket.org/kami/django-registration/commits/6a0aff33bcf2cc24190916c74bc1b6822622d45a
Bug-Debian: http://bugs.debian.org/745756
Author: Tomaz Muraus
Last-Update: 2014-05-27

--- python-django-registration-1.0.orig/registration/views.py
+++ python-django-registration-1.0/registration/views.py
@@ -7,7 +7,6 @@ from django.shortcuts import redirect
 from django.views.generic.base import TemplateView
 from django.views.generic.edit import FormView
 
-from registration import signals
 from registration.forms import RegistrationForm
 
 
@@ -120,9 +119,6 @@ class ActivationView(TemplateView):
     def get(self, request, *args, **kwargs):
         activated_user = self.activate(request, *args, **kwargs)
         if activated_user:
-            signals.user_activated.send(sender=self.__class__,
-                                        user=activated_user,
-                                        request=request)
             success_url = self.get_success_url(request, activated_user)
             try:
                 to, args, kwargs = success_url