Browse Source

Merge branch 'fix_invoice' into 'dev'

Fix name of user after invoice comnpay + acl delete invoice

See merge request federez/re2o!334
docker_basic_support
klafyvel 7 years ago
parent
commit
f5638ca425
  1. 6
      cotisations/models.py
  2. 4
      cotisations/payment_methods/comnpay/views.py

6
cotisations/models.py

@ -182,10 +182,12 @@ class Facture(BaseInvoice):
def can_delete(self, user_request, *args, **kwargs): def can_delete(self, user_request, *args, **kwargs):
if not user_request.has_perm('cotisations.delete_facture'): if not user_request.has_perm('cotisations.delete_facture'):
return False, _("You don't have the right to delete an invoice.") return False, _("You don't have the right to delete an invoice.")
if not self.user.can_edit(user_request, *args, **kwargs)[0]: elif not user_request.has_perm('cotisations.change_all_facture') and \
not self.user.can_edit(user_request, *args, **kwargs)[0]:
return False, _("You don't have the right to delete this user's " return False, _("You don't have the right to delete this user's "
"invoices.") "invoices.")
if self.control or not self.valid: elif not user_request.has_perm('cotisations.change_all_facture') and \
(self.control or not self.valid):
return False, _("You don't have the right to delete an invoice " return False, _("You don't have the right to delete an invoice "
"already controlled or invalidated.") "already controlled or invalidated.")
else: else:

4
cotisations/payment_methods/comnpay/views.py

@ -62,8 +62,8 @@ def accept_payment(request, factureid):
request, request,
_("The subscription of %(member_name)s was extended to" _("The subscription of %(member_name)s was extended to"
" %(end_date)s.") % { " %(end_date)s.") % {
'member_name': request.user.pseudo, 'member_name': invoice.user.pseudo,
'end_date': request.user.end_adhesion() 'end_date': invoice.user.end_adhesion()
} }
) )
return redirect(reverse( return redirect(reverse(

Loading…
Cancel
Save