-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: login in debug/dev mode #829
base: master
Are you sure you want to change the base?
Conversation
@@ -38,6 +40,10 @@ def send_magic_link(user, next_url): | |||
template_id=settings.SIB_MAGIC_LINK_TEMPLATE, | |||
) | |||
|
|||
if settings.DEBUG is True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tu as besoin d'ajouter cette spécificité pour le debug ? est-ce que le mode de production ne devrait pas suffir ?
<div id="debug-mode-banner"> | ||
{% if DEBUG %}<div class="bg-danger text-white mt-3">DEBUG MODE</div>{% endif %} | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait wrapper le div entière dans le {% if %}
pour ne pas avoir la div#debug-mode-banner
en prod.
@@ -38,6 +40,10 @@ def send_magic_link(user, next_url): | |||
template_id=settings.SIB_MAGIC_LINK_TEMPLATE, | |||
) | |||
|
|||
if settings.DEBUG is True: | |||
message = mark_safe(f'<a href="{login_link}">Login link</a> sent to {user.email}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ce n’est pas safe
. format_html
avec deux paramètres ?
@override_settings( | ||
DEBUG=True, | ||
INSTALLED_APPS=[app for app in settings.INSTALLED_APPS if app != "debug_toolbar"], | ||
MIDDLEWARE=[ | ||
middleware | ||
for middleware in settings.MIDDLEWARE | ||
if middleware != "debug_toolbar.middleware.DebugToolbarMiddleware" | ||
], | ||
DEBUG_TOOLBAR_CONFIG={}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu ne voulais pas réutiliser la fixture override_debug_toolbar_settings_fixture
?
Description
🎸 lorsque le mode DEBUG est actif:
django.contrib.auth.urls
Type de changement
🎢 Nouvelle fonctionnalité (changement non cassant qui ajoute une fonctionnalité).
🚧 technique
Points d'attention
🦺 passage de la valeur de la variable
DEBUG
dans lecontext_processor
Captures d'écran (optionnel)
Banniere Debug Mode
Lien cliquable d'authentification en mode debug