Commit 20868fab authored by Noe Nieto's avatar Noe Nieto 💬

Remove the top-right account/profile navigation on cart pages when...

Remove the top-right account/profile navigation on cart pages when DEBUG_REGISTER_STATUS is True; ref Purism/LibremOne/task#167
parent f1128bf6
Pipeline #5127 canceled with stage
......@@ -5,6 +5,12 @@
{% block header %}{% trans 'Register' %}{% endblock %}
{% block byline %}{% trans 'Please fill in your registration details' %}{% endblock %}
{% block login_status %}
{% if DEBUG_REGISTER_STATUS %}
{{ block.super }}
{% endif %}
{% endblock %}
{% block content %}
<form method="post" action=".">
{% csrf_token %}
......
......@@ -19,6 +19,11 @@ class CartRegistrationView(RegistrationView):
template_name = 'cart/registration_form.html'
reward = None
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['DEBUG_REGISTER_STATUS'] = settings.DEBUG_REGISTER_STATUS
return context
def get(self, *args, **kwargs):
logout(self.request)
valid_cart_numbers = list(set().union(settings.WOO_CART_BASIC, settings.WOO_CART_COMPLETE))
......
......@@ -10,6 +10,7 @@ SITE_PROVIDER_LINK=https://example.com
DEBUG=True
DEBUG_ALL_ACCESS=True
DEBUG_CHANGE_PASSWORD=False
DEBUG_REGISTER_STATUS = True
DEBUG_SKIP_ACTIVATION_COMMAND=True
DEBUG_SKIP_VALIDATE_ON_AUTHENTICATION = False
# change to false after initial setup
......
......@@ -28,6 +28,7 @@ SPDX-License-Identifier: AGPL-3.0
<p>{% block byline %}Byline{% endblock %}</p>
</div>
</div>
{% block login_status %}
<div id="log_state">
{% if user.is_authenticated %}
{% trans "Logged in as" %} {{ user.username }}<br/>
......@@ -45,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0
-->
{% endif %}
</div>
{% endblock %}
</header>
<hr/>
......
......@@ -35,6 +35,7 @@ DEBUG_ALL_ACCESS = config("DEBUG_ALL_ACCESS", cast=bool)
DEBUG_CHANGE_PASSWORD = config("DEBUG_CHANGE_PASSWORD", cast=bool)
DEBUG_SKIP_ACTIVATION_COMMAND = config("DEBUG_SKIP_ACTIVATION_COMMAND", cast=bool)
DEBUG_SKIP_VALIDATE_ON_AUTHENTICATION = config("DEBUG_SKIP_VALIDATE_ON_AUTHENTICATION", cast=bool)
DEBUG_REGISTER_STATUS = config("DEBUG_REGISTER_STATUS", cast=bool)
# Required if DEBUG is False
ALLOWED_HOSTS = config("ALLOWED_HOSTS", cast=Csv())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment