diff --git a/dmoj/settings.py b/dmoj/settings.py index ff67fab3bd..36c44c71e1 100644 --- a/dmoj/settings.py +++ b/dmoj/settings.py @@ -572,6 +572,8 @@ 'django.contrib.auth.backends.ModelBackend', ) +REGISTRATION_OPEN = True + SOCIAL_AUTH_PIPELINE = ( 'social_core.pipeline.social_auth.social_details', 'social_core.pipeline.social_auth.social_uid', diff --git a/judge/template_context.py b/judge/template_context.py index cc3b6f29f2..8c08dda5e7 100644 --- a/judge/template_context.py +++ b/judge/template_context.py @@ -61,6 +61,7 @@ def general_info(request): 'nav_tab': FixedSimpleLazyObject(partial(__nav_tab, request.path)), 'nav_bar': NavigationBar.objects.all(), 'LOGIN_RETURN_PATH': '' if path.startswith('/accounts/') else path, + 'REGISTRATION_OPEN': settings.REGISTRATION_OPEN, 'perms': PermWrapper(request.user), 'HAS_WEBAUTHN': bool(settings.WEBAUTHN_RP_ID), } diff --git a/templates/base.html b/templates/base.html index 95973f31f5..c04021d0a1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -237,8 +237,10 @@ {% else %} {{ _('Log in') }} -  {{ _('or') }}  - {{ _('Sign up') }} + {% if REGISTRATION_OPEN %} +  {{ _('or') }}  + {{ _('Sign up') }} + {% endif %} {% endif %}