Revision e5966bd9 snf-astakos-app/astakos/im/util.py
b/snf-astakos-app/astakos/im/util.py | ||
---|---|---|
107 | 107 |
""" |
108 | 108 |
Return url if having the supplied ``domain`` (if present) or one of the ``allowed_schemes``. |
109 | 109 |
Otherwise return None. |
110 |
|
|
110 |
|
|
111 | 111 |
>>> print restrict_next('/im/feedback', '.okeanos.grnet.gr') |
112 | 112 |
/im/feedback |
113 | 113 |
>>> print restrict_next('pithos.okeanos.grnet.gr/im/feedback', '.okeanos.grnet.gr') |
... | ... | |
168 | 168 |
try: |
169 | 169 |
user.save() |
170 | 170 |
except ValidationError, e: |
171 |
return HttpResponseBadRequest(e)
|
|
172 |
|
|
171 |
return HttpResponseBadRequest(e) |
|
172 |
|
|
173 | 173 |
next = restrict_next(next, domain=COOKIE_DOMAIN) |
174 |
|
|
174 |
|
|
175 | 175 |
if FORCE_PROFILE_UPDATE and not user.is_verified and not user.is_superuser: |
176 | 176 |
params = '' |
177 | 177 |
if next: |
... | ... | |
187 | 187 |
|
188 | 188 |
if not next: |
189 | 189 |
next = reverse('astakos.im.views.index') |
190 |
|
|
190 |
|
|
191 | 191 |
response['Location'] = next |
192 | 192 |
response.status_code = 302 |
193 | 193 |
return response |
... | ... | |
209 | 209 |
|
210 | 210 |
|
211 | 211 |
def reserved_email(email): |
212 |
return AstakosUser.objects.filter(email__iexact=email).count() > 0 or \ |
|
213 |
AstakosUser.objects.filter(username__iexact=email).count() > 0 |
|
212 |
return AstakosUser.objects.user_exists(email) |
|
214 | 213 |
|
215 | 214 |
|
216 | 215 |
def get_query(request): |
Also available in: Unified diff