Skip to content

Commit 1dc8331

Browse files
committed
Merge branch '242-verify-email-issue' into 'main'
fix: Fixed verify email page appearing when neither email confirmation nor SMTP server are enabled Closes #242 See merge request yaal/canaille!247
2 parents 91c5549 + f19e924 commit 1dc8331

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

canaille/core/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class CoreSettings(BaseModel):
260260
HTMX: bool = True
261261
"""Accelerates webpages loading with asynchronous requests."""
262262

263-
EMAIL_CONFIRMATION: bool = True
263+
EMAIL_CONFIRMATION: bool | None = None
264264
"""If :py:data:`True`, users will need to click on a confirmation link sent
265265
by email when they want to add a new email.
266266

canaille/core/endpoints/account.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def join():
7979
if not current_app.features.has_registration:
8080
abort(404)
8181

82-
if not current_app.config["CANAILLE"]["EMAIL_CONFIRMATION"]:
82+
if not current_app.features.has_email_confirmation:
8383
return redirect(url_for(".registration"))
8484

8585
if current_user():

tests/app/fixtures/current-app-config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ JAVASCRIPT = false
7979
#
8080
# By default, this is true if SMTP is configured, else this is false. If
8181
# explicitly set to true and SMTP is disabled, the email field will be read-only.
82-
# EMAIL_CONFIRMATION = true
82+
# EMAIL_CONFIRMATION =
8383

8484
# If True, then users can freely create an account at this instance.
8585
#

tests/app/fixtures/default-config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#
7474
# By default, this is true if SMTP is configured, else this is false. If
7575
# explicitly set to true and SMTP is disabled, the email field will be read-only.
76-
# EMAIL_CONFIRMATION = true
76+
# EMAIL_CONFIRMATION =
7777

7878
# If True, then users can freely create an account at this instance.
7979
#

0 commit comments

Comments
 (0)