8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 03:43:12 +00:00

Typos, pep8 et company.

This commit is contained in:
Hugo LEVY-FALK 2018-07-03 13:58:10 +02:00
parent 0fe430d72e
commit af3cc1cf69
3 changed files with 38 additions and 35 deletions

View file

@ -221,7 +221,7 @@ class Facture(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
@staticmethod @staticmethod
def can_create(user_request, *_args, **_kwargs): def can_create(user_request, *_args, **_kwargs):
"""Check if an user can create an invoice. """Check if a user can create an invoice.
:param user_request: The user who wants to create an invoice. :param user_request: The user who wants to create an invoice.
:return: a message and a boolean which is True if the user can create :return: a message and a boolean which is True if the user can create

View file

@ -101,13 +101,16 @@ def new_facture(request, user, userid):
# Building the invocie form and the article formset # Building the invocie form and the article formset
is_self_subscription = False is_self_subscription = False
can_create_invoice = request.user.has_perm('cotisations.add_facture') can_create_invoice = request.user.has_perm('cotisations.add_facture')
allow_self_subscription = OptionalUser.get_cached_value('allow_self_subscription') allow_self_subscription = OptionalUser.get_cached_value(
'allow_self_subscription')
if not can_create_invoice: if not can_create_invoice:
if allow_self_subscription: if allow_self_subscription:
is_self_subscription = True is_self_subscription = True
article_list = article_list.filter(allow_self_subscription=True) article_list = article_list.filter(allow_self_subscription=True)
allowed_payment = Paiement.objects.filter(allow_self_subscription=True) allowed_payment = Paiement.objects.filter(
invoice_form = NewFactureForm(request.POST or None, instance=invoice, allowed_payment=allowed_payment) allow_self_subscription=True)
invoice_form = NewFactureForm(
request.POST or None, instance=invoice, allowed_payment=allowed_payment)
else: else:
messages.error( messages.error(
request, request,
@ -165,7 +168,6 @@ def new_facture(request, user, userid):
)) ))
new_invoice_instance.save() new_invoice_instance.save()
# Building a purchase for each article sold # Building a purchase for each article sold
for art_item in articles: for art_item in articles:
if art_item.cleaned_data: if art_item.cleaned_data:

View file

@ -287,7 +287,8 @@ non adhérent</span>{% endif %} et votre connexion est {% if users.has_access %}
{% if user_solde %} {% if user_solde %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new_facture_solde' user.id %}"> <a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new_facture_solde' user.id %}">
<i class="fa fa-euro-sign"></i> <i class="fa fa-euro-sign"></i>
Ajouter une cotisation par solde</a> Ajouter une cotisation par solde
</a>
{% endif %} {% endif %}
{% acl_end %} {% acl_end %}
</div> </div>