mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +00:00
Show clearer behavior when no email confirmation is needed after all
This commit is contained in:
parent
34be995125
commit
a6cb46356f
1 changed files with 4 additions and 1 deletions
|
@ -91,9 +91,12 @@ class ConfirmEmailCode(View):
|
||||||
def get(self, request, code): # pylint: disable=unused-argument
|
def get(self, request, code): # pylint: disable=unused-argument
|
||||||
"""you got the code! good work"""
|
"""you got the code! good work"""
|
||||||
settings = models.SiteSettings.get()
|
settings = models.SiteSettings.get()
|
||||||
if request.user.is_authenticated or not settings.require_confirm_email:
|
if request.user.is_authenticated:
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
|
|
||||||
|
if not settings.require_confirm_email:
|
||||||
|
return redirect("login")
|
||||||
|
|
||||||
# look up the user associated with this code
|
# look up the user associated with this code
|
||||||
try:
|
try:
|
||||||
user = models.User.objects.get(confirmation_code=code)
|
user = models.User.objects.get(confirmation_code=code)
|
||||||
|
|
Loading…
Reference in a new issue