Upgrade black and format accordingly

This commit is contained in:
Antoine Bartuccio 2020-08-27 15:59:42 +02:00
parent f485178422
commit f34f5fe693
Signed by: klmp200
GPG Key ID: E7245548C53F904B
24 changed files with 88 additions and 91 deletions

View File

@ -1490,7 +1490,9 @@ class OperationLog(models.Model):
User, related_name="logs", on_delete=models.SET_NULL, null=True User, related_name="logs", on_delete=models.SET_NULL, null=True
) )
operation_type = models.CharField( operation_type = models.CharField(
_("operation type"), max_length=40, choices=settings.SITH_LOG_OPERATION_TYPE, _("operation type"),
max_length=40,
choices=settings.SITH_LOG_OPERATION_TYPE,
) )
def is_owned_by(self, user): def is_owned_by(self, user):

View File

@ -114,14 +114,11 @@ class SelectFile(TextInput):
attrs["class"] = "select_file" attrs["class"] = "select_file"
else: else:
attrs = {"class": "select_file"} attrs = {"class": "select_file"}
output = ( output = '%(content)s<div name="%(name)s" class="choose_file_widget" title="%(title)s"></div>' % {
'%(content)s<div name="%(name)s" class="choose_file_widget" title="%(title)s"></div>'
% {
"content": super(SelectFile, self).render(name, value, attrs, renderer), "content": super(SelectFile, self).render(name, value, attrs, renderer),
"title": _("Choose file"), "title": _("Choose file"),
"name": name, "name": name,
} }
)
output += ( output += (
'<span name="' '<span name="'
+ name + name
@ -138,14 +135,11 @@ class SelectUser(TextInput):
attrs["class"] = "select_user" attrs["class"] = "select_user"
else: else:
attrs = {"class": "select_user"} attrs = {"class": "select_user"}
output = ( output = '%(content)s<div name="%(name)s" class="choose_user_widget" title="%(title)s"></div>' % {
'%(content)s<div name="%(name)s" class="choose_user_widget" title="%(title)s"></div>'
% {
"content": super(SelectUser, self).render(name, value, attrs, renderer), "content": super(SelectUser, self).render(name, value, attrs, renderer),
"title": _("Choose user"), "title": _("Choose user"),
"name": name, "name": name,
} }
)
output += ( output += (
'<span name="' '<span name="'
+ name + name

View File

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

View File

@ -120,8 +120,7 @@ class ShoppingList(models.Model):
class ShoppingListItem(models.Model): class ShoppingListItem(models.Model):
""" """"""
"""
shopping_lists = models.ManyToManyField( shopping_lists = models.ManyToManyField(
ShoppingList, ShoppingList,