diff --git a/.env.example b/.env.example index 998150c..63df700 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,10 @@ # When the environment is "development", DEBUG is set to True. SERVALA_ENVIRONMENT='development' +# Set to "False" to disable the beta testing banner at the top of every page. +# Defaults to "True". +SERVALA_SHOW_BETA_BANNER='True' + # Set SERVALA_PREVIOUS_SECRET_KEY when rotating to a new secret key in order to not expire all sessions and to remain able to read encrypted fields! # In order to retire the previous key, run the ``reencrypt_fields`` command. Once you drop the previous secret key from # the rotation, all sessions that still rely on that key will be invalidated (i.e., users will have to log in again). diff --git a/src/servala/core/models/organization.py b/src/servala/core/models/organization.py index 78605f6..646849f 100644 --- a/src/servala/core/models/organization.py +++ b/src/servala/core/models/organization.py @@ -387,7 +387,8 @@ class OrganizationOrigin(ServalaModelMixin, models.Model): help_text=_( "If set, this billing entity will be used on new organizations with this origin." ), - null=True, blank=True, + null=True, + blank=True, ) limit_cloudproviders = models.ManyToManyField( to="CloudProvider", diff --git a/src/servala/frontend/context_processors.py b/src/servala/frontend/context_processors.py index 1ff2a14..78dc0a9 100644 --- a/src/servala/frontend/context_processors.py +++ b/src/servala/frontend/context_processors.py @@ -1,5 +1,12 @@ +from django.conf import settings + + def add_organizations(request): if not request.user.is_authenticated: return {"user_organizations": []} return {"user_organizations": request.user.organizations.all().order_by("name")} + + +def add_beta_banner(request): + return {"show_beta_banner": settings.SERVALA_SHOW_BETA_BANNER} diff --git a/src/servala/frontend/templates/frontend/base.html b/src/servala/frontend/templates/frontend/base.html index 7c6bc54..620cb6d 100644 --- a/src/servala/frontend/templates/frontend/base.html +++ b/src/servala/frontend/templates/frontend/base.html @@ -22,6 +22,7 @@