131 |
131 |
132 def resend_activation(request): |
132 def resend_activation(request): |
133 """ resend only if user is registered and is inactive. |
133 """ resend only if user is registered and is inactive. |
134 """ |
134 """ |
135 |
135 |
|
136 user = request.user |
136 try: |
137 try: |
137 email = request.GET['email'] |
138 email = request.GET['email'] |
138 except MultiValueDictKeyError: |
139 except MultiValueDictKeyError: |
139 raise Http404 |
140 raise Http404 |
140 |
141 |
141 try: |
142 try: |
142 user = User.objects.get(email__iexact=email) |
143 new_user = User.objects.get(email__iexact=email) |
143 except User.DoesNotExist: |
144 except User.DoesNotExist: |
144 raise Http404 |
145 raise Http404 |
145 |
146 |
146 if user.is_active: |
147 if new_user.is_active: |
147 return redirect('/reg') |
148 return redirect('/reg') |
148 |
149 |
149 profile = user.get_profile() |
150 profile = new_user.get_profile() |
150 activation_key = profile.activation_key |
151 activation_key = profile.activation_key |
151 reg_events.send_activation(user) |
152 reg_events.send_activation(new_user) |
152 |
153 |
153 return render_to_response('sent_activationkey.html', {'user':user}) |
154 return render_to_response('sent_activationkey.html', {'user':user}) |
154 |
155 |
155 def create_event(request): |
156 def create_event(request): |
156 """ see if the user is a staff and only then let him do it. |
157 """ see if the user is a staff and only then let him do it. |