diff libervia/pages/register/page_meta.py @ 1404:6a35167a4e2c

pages (login, register): fix `allow_registration`: if `allow_registration` is false: - `register_url` is not set in login page - register page returns HTTP_FORBIDDEN
author Goffi <goffi@goffi.org>
date Fri, 16 Apr 2021 18:38:45 +0200
parents f511f8fbbf8a
children ce879da7fcf7
line wrap: on
line diff
--- a/libervia/pages/register/page_meta.py	Sat Mar 27 15:23:49 2021 +0100
+++ b/libervia/pages/register/page_meta.py	Fri Apr 16 18:38:45 2021 +0200
@@ -16,6 +16,8 @@
 
 
 def prepare_render(self, request):
+    if not self.host.options["allow_registration"]:
+        self.pageError(request, C.HTTP_FORBIDDEN)
     profile = self.getProfile(request)
     if profile is not None:
         self.pageRedirect("/login/logged", request)