diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-05-20 21:29:12 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-05-20 21:29:12 +0300 |
commit | 06f9de360a785ab7cf50a7c837ab244dd406bdbc (patch) | |
tree | 7d6ec82039b6c1fbd76e069dde2efb0d1ea03935 /core/views | |
parent | d06526846feb31cb26fa4ba491e090455cd75b30 (diff) | |
download | troggle-06f9de360a785ab7cf50a7c837ab244dd406bdbc.tar.gz troggle-06f9de360a785ab7cf50a7c837ab244dd406bdbc.tar.bz2 troggle-06f9de360a785ab7cf50a7c837ab244dd406bdbc.zip |
notes made, work still to do
Diffstat (limited to 'core/views')
-rw-r--r-- | core/views/user_registration.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/views/user_registration.py b/core/views/user_registration.py index 2bfacec..814eb07 100644 --- a/core/views/user_registration.py +++ b/core/views/user_registration.py @@ -141,20 +141,26 @@ def register(request, url_username=None): """
warning = ""
initial_values={"visible-passwords": "True"}
+ print(f"{url_username=}")
logged_in = (identified_login := is_identified_user(request.user))
if logged_in:
# logged in as a known real person with a User logon
+ print(f"Already logged in as {identified_login=}, redirecting to re_register_email()")
return re_register_email(request) # discarding url_username
if not request.user.is_anonymous:
- # logged in as expo or expoadmin, so logout invisibly before we do anything
+ # Anonymous users are not logged in as anybody.
+ print(f"user is logged in as somebody (but not an identified person, so 'expo'), redirecting to expologout()")
+ # logged in as expo or expoadmin, or as a real person, so logout invisibly before we do anything
expologout(request) # returns a response, which we discard
if url_username: # if provided in URL
+ print(url_username, Person.objects.filter(slug=url_username).count())
+ # This is where we need to check that this url_username has or has not already been registered.
+ # to do..
if Person.objects.filter(slug=url_username).count() != 1:
# not an old expoer, so redirect to the other form
- print(url_username, Person.objects.filter(slug=url_username).count())
return HttpResponseRedirect("/accounts/newregister/")
initial_values.update({"username": url_username})
|