Compare commits

...

5 commits

Author SHA1 Message Date
Bastien Roy
e7aea8f8d2 Merge branch 'feature/166/rendre-telephone-non-obligatoire' into 'develop'
[166] Rendre le telephone non obligatoire

Closes #166

See merge request la-chariotte/la-chariotte!108
2024-10-30 19:31:57 +00:00
xmeunier
c0c2d40286 Fix change-password and Connect buttons 2024-10-29 22:17:52 +01:00
28290f20de
Fix the password reset form
Django crispy is bow using a filter rather than a tag.

Using the `crispy` tag resulted in two imbricated forms being
generated, and a broken "send" button.
2024-10-27 23:18:58 +01:00
xmeunier
44a2c20f95 Simpler solution to prevent unitended OrderAuthor 2024-10-20 15:06:10 +02:00
mobilinux
84dadd9147 Prevent inintended creation of OrderAuthor before ordering
When a grouped_order_detail view was called with authenticated user,
when prefilling the firstName, lastName and email also inserted a new
OrderAuthor object in the database.
Now use SimpleNamespace, instead of OrderAuthor object, to carry
those values to the template.
2024-10-20 12:50:55 +00:00
4 changed files with 5 additions and 5 deletions

View file

@ -8,6 +8,6 @@
</p>
<div class="box">
<p>Votre mot de passe a été correctement réinitialisé. Vous pouvez maintenant vous connecter.</p>
<button class="button is-primary" href="{% url 'accounts:login'%}">Se connecter</button>
<a class="button is-primary" href="{% url 'accounts:login' %}">Se connecter</a>
</div>
{% endblock %}

View file

@ -9,8 +9,8 @@
{% if validlink %}
<form method="POST">
<p>Veuillez entrer un nouveau mot de passe tout neuf.</p>
{{ form | crispy }}
{% csrf_token %}
{% crispy form %}
<input class="button is-primary"
type="submit"
value="Changer le mot de passe">

View file

@ -8,7 +8,8 @@
<div class="box">
<form method="POST">
<p>Entrez votre mail pour recevoir les instructions pour le réinitialiser.</p>
{% crispy form %}
{{ form | crispy }}
{% csrf_token %}
<div class="buttons">
<input class="button is-primary" type="submit" value="Envoyer">
</div>

View file

@ -119,12 +119,11 @@ class GroupedOrderDetailView(generic.DetailView):
prices_dict = {item.id: item.price for item in items}
if self.request.user.is_authenticated:
order_author = OrderAuthor.objects.create(
order_author = OrderAuthor(
first_name=self.request.user.first_name,
last_name=self.request.user.last_name,
email=self.request.user.username,
)
order_author.save()
else:
order_author = None