8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-22 23:13:46 +00:00

Merge branch 'fix_invoice' into 'dev'

Fix name of user after invoice comnpay + acl delete invoice

See merge request federez/re2o!334
This commit is contained in:
klafyvel 2018-10-14 16:56:19 +02:00
commit f5638ca425
2 changed files with 6 additions and 4 deletions

View file

@ -182,10 +182,12 @@ class Facture(BaseInvoice):
def can_delete(self, user_request, *args, **kwargs):
if not user_request.has_perm('cotisations.delete_facture'):
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 "
"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 "
"already controlled or invalidated.")
else:

View file

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