mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-19 08:17:17 +00:00
prevent re-register not working
This commit is contained in:
@@ -19,11 +19,12 @@ from troggle.core.views.auth import expologout
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
This is the new individual user login registration, instead of everyone signing
|
This is the new individual user login registration, instead of everyone signing
|
||||||
in as "expo". This will be useful for the kanban expo organisation tool.
|
in as "expo". This will be useful for the kanban expo organisation tool.. maybe?
|
||||||
"""
|
"""
|
||||||
|
|
||||||
todo = """
|
todo = """
|
||||||
- Make all this work with New people who have never been on expo before
|
- Make all this work with New people who have never been on expo before
|
||||||
|
- Stop anyone re-registering an email for an id which already has an email
|
||||||
|
|
||||||
- login automatically, and redirect to control panel ?
|
- login automatically, and redirect to control panel ?
|
||||||
"""
|
"""
|
||||||
@@ -135,7 +136,7 @@ def register(request, url_username=None):
|
|||||||
similar to the "expo" user
|
similar to the "expo" user
|
||||||
(with cavey:beery password) but specific to an individual.
|
(with cavey:beery password) but specific to an individual.
|
||||||
|
|
||||||
We only allow this to be done ONCE for each user-id.
|
We should only allow this to be done ONCE for each user-id. But this constraint seems to be broken.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
warning = ""
|
warning = ""
|
||||||
@@ -143,7 +144,7 @@ def register(request, url_username=None):
|
|||||||
|
|
||||||
logged_in = (identified_login := is_identified_user(request.user))
|
logged_in = (identified_login := is_identified_user(request.user))
|
||||||
if logged_in:
|
if logged_in:
|
||||||
# logged in as a known real person with a USer logon
|
# logged in as a known real person with a User logon
|
||||||
return re_register_email(request) # discarding url_username
|
return re_register_email(request) # discarding url_username
|
||||||
|
|
||||||
if not request.user.is_anonymous:
|
if not request.user.is_anonymous:
|
||||||
@@ -153,7 +154,7 @@ def register(request, url_username=None):
|
|||||||
if url_username: # if provided in URL
|
if url_username: # if provided in URL
|
||||||
if Person.objects.filter(slug=url_username).count() != 1:
|
if Person.objects.filter(slug=url_username).count() != 1:
|
||||||
# not an old expoer, so redirect to the other form
|
# not an old expoer, so redirect to the other form
|
||||||
print(Person.objects.filter(slug=url_username).count())
|
print(url_username, Person.objects.filter(slug=url_username).count())
|
||||||
return HttpResponseRedirect("/accounts/newregister/")
|
return HttpResponseRedirect("/accounts/newregister/")
|
||||||
|
|
||||||
initial_values.update({"username": url_username})
|
initial_values.update({"username": url_username})
|
||||||
|
|||||||
Reference in New Issue
Block a user