Upgrade black and format accordingly

This commit is contained in:
2020-08-27 15:59:42 +02:00
parent f485178422
commit f34f5fe693
24 changed files with 88 additions and 91 deletions

View File

@ -89,9 +89,9 @@ class Customer(models.Model):
def save(self, allow_negative=False, is_selling=False, *args, **kwargs):
"""
is_selling : tell if the current action is a selling
allow_negative : ignored if not a selling. Allow a selling to put the account in negative
Those two parameters avoid blocking the save method of a customer if his account is negative
is_selling : tell if the current action is a selling
allow_negative : ignored if not a selling. Allow a selling to put the account in negative
Those two parameters avoid blocking the save method of a customer if his account is negative
"""
if self.amount < 0 and (is_selling and not allow_negative):
raise ValidationError(_("Not enough money"))
@ -527,7 +527,7 @@ class Selling(models.Model):
def save(self, allow_negative=False, *args, **kwargs):
"""
allow_negative : Allow this selling to use more money than available for this user
allow_negative : Allow this selling to use more money than available for this user
"""
if not self.date:
self.date = timezone.now()

View File

@ -55,7 +55,9 @@ def write_log(instance, operation_type):
return None
log = OperationLog(
label=str(instance), operator=get_user(), operation_type=operation_type,
label=str(instance),
operator=get_user(),
operation_type=operation_type,
).save()