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
)
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):

View File

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

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()

View File

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