8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 22:22:26 +00:00

Fix : various little things

This commit is contained in:
Maël Kervella 2018-04-15 13:34:51 +00:00
parent 6c30c36943
commit f7f8f7493b
3 changed files with 7 additions and 5 deletions

View file

@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post">
{% csrf_token %}
{% if articlesformset %}
<h3>{% trans "Invoice's articles" %}</h3>
<div id="form_set" class="form-group">
{{ articlesformset.management_form }}
@ -54,11 +55,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Total price : <span id="total_price">0,00</span>
{% endblocktrans %}
</p>
{% endif %}
{% bootstrap_form factureform %}
{% bootstrap_button action_name button_type='submit' icon='star' %}
</form>
{% if articlesformset %}
<script type="text/javascript">
var prices = {};
{% for article in articles %}
@ -133,6 +135,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
update_price();
});
</script>
{% endif %}
{% endblock %}

View file

@ -489,7 +489,7 @@ def add_paiement(request):
# TODO : chnage paiement to Payment
@login_required
@can_edit(Paiement)
def edit_paiement(request, paiement_instance, *_kwargs):
def edit_paiement(request, paiement_instance, **_kwargs):
"""
View used to edit a payment method.
"""

View file

@ -171,13 +171,13 @@ def can_delete_set(model):
all_objects = model.objects.all()
instances_id = []
for instance in all_objects:
can, msg = instance.can_delete(request.user)
can, _msg = instance.can_delete(request.user)
if can:
instances_id.append(instance.id)
instances = model.objects.filter(id__in=instances_id)
if not instances:
messages.error(
request, msg or "Vous ne pouvez pas accéder à ce menu")
request, "Vous ne pouvez pas accéder à ce menu")
return redirect(reverse(
'users:profil',
kwargs={'userid': str(request.user.id)}