From a918e530785e9a32cbacbd3ff7558952a6cf2ce3 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 25 Oct 2021 13:43:50 +0200 Subject: [PATCH] data: allow blank values for urls in site settings (#58152) --- combo/data/models.py | 2 ++ tests/test_manager.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/combo/data/models.py b/combo/data/models.py index 8640e03b..aff99173 100644 --- a/combo/data/models.py +++ b/combo/data/models.py @@ -2211,9 +2211,11 @@ class SiteSettings(models.Model): _('Welcome page path'), help_text=_('Page to redirect to on the first visit, to suggest user to log in.'), max_length=100, + blank=True, ) initial_login_page_path = models.CharField( _('Initial login page path'), help_text=_('Page to redirect to the first time user logs in.'), max_length=100, + blank=True, ) diff --git a/tests/test_manager.py b/tests/test_manager.py index 8c2d08ed..2f06812c 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -2648,3 +2648,11 @@ def test_site_settings(app, admin_user): site_settings = SiteSettings.objects.get() assert site_settings.welcome_page_path == '/welcome/' assert site_settings.initial_login_page_path == '/initial-login/' + + resp.form['welcome_page_path'] = '' + resp.form['initial_login_page_path'] = '' + resp.form.submit() + + site_settings.refresh_from_db() + assert site_settings.welcome_page_path == '' + assert site_settings.initial_login_page_path == '' -- 2.30.2