mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2025-07-09 18:10:19 +02:00
Linting
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
from random import random
|
||||
from time import sleep
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.management import BaseCommand
|
||||
from media.forms import MediaAdminForm
|
||||
from media.models import BD, FutureMedia, Manga, Roman
|
||||
@ -25,7 +24,9 @@ class Command(BaseCommand):
|
||||
continue
|
||||
|
||||
if cl.objects.filter(isbn=isbn).exists():
|
||||
self.stderr.write(self.style.WARNING(f"ISBN {isbn} for type {type_str} already exists, remove it"))
|
||||
self.stderr.write(self.style.WARNING(
|
||||
f"ISBN {isbn} for type {type_str} already exists, "
|
||||
f"remove it"))
|
||||
future_medium.delete()
|
||||
continue
|
||||
|
||||
@ -36,7 +37,8 @@ class Command(BaseCommand):
|
||||
|
||||
try:
|
||||
form.full_clean()
|
||||
if hasattr(form.instance, "subtitle") and not form.instance.subtitle:
|
||||
if hasattr(form.instance, "subtitle") and \
|
||||
not form.instance.subtitle:
|
||||
form.instance.subtitle = ""
|
||||
form.save()
|
||||
future_medium.delete()
|
||||
@ -46,4 +48,5 @@ class Command(BaseCommand):
|
||||
except Exception as e:
|
||||
self.stderr.write(self.style.WARNING(
|
||||
"An error occured while importing ISBN {isbn}: {error}"
|
||||
.format(isbn=isbn, error=str(e.__class__) + "(" + str(e) + ")")))
|
||||
.format(isbn=isbn,
|
||||
error=str(e.__class__) + "(" + str(e) + ")")))
|
||||
|
Reference in New Issue
Block a user