# -*- encoding: utf-8 -*-
import settings
+from auf.django.references import models as ref
PROJET_TITRE_KEY = 'PROJET_TITRE'
if not site:
site = "Créer une clef '%s' dans settings.py" % PROJET_TITRE_KEY
+ # le User peut changer de mdp s'il est local
+ try:
+ email = request.user.email
+ can_change_password = not ref.Authentification.objects.filter(courriel=email).exists()
+ except:
+ can_change_password = None
+
return {
'AUF_SITE' : site,
+ 'can_change_password' : can_change_password,
}
-{% load theming_tags %}
+{% load i18n theming_tags auf_admin %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
{% block extrahead %}{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
</head>
-{% load i18n %}
<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">
{% endif %}
<a href="/">Voir le site</a> /
-
- {% url admin:password_change as password_change_url %}
- {% if password_change_url %}
- <a href="{{ password_change_url }}">
- {% else %}
- <a href="{{ root_path }}password_change/">
+ {% if can_change_password %}
+ {% url admin:password_change as password_change_url %}
+ {% if password_change_url %}
+ <a href="{{ password_change_url }}">
+ {% else %}
+ <a href="{{ root_path }}password_change/">
+ {% endif %}
+ {% trans 'Change password' %}</a> /
{% endif %}
- {% trans 'Change password' %}</a> /
{% url admin:logout as logout_url %}
{% if logout_url %}
<a href="{{ logout_url }}">