From 1c8d5750bb877bcc383258fa968dad6f238d80fe Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 12 May 2020 17:34:53 +0200 Subject: [PATCH] Fix linters --- med/admin.py | 1 - media/admin.py | 2 +- media/forms.py | 6 ++++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/med/admin.py b/med/admin.py index e6365ff..acb795d 100644 --- a/med/admin.py +++ b/med/admin.py @@ -7,7 +7,6 @@ from django.contrib.auth.admin import Group, GroupAdmin from django.contrib.sites.admin import Site, SiteAdmin from django.utils.translation import gettext_lazy as _ from django.views.decorators.cache import never_cache - from media.models import Emprunt diff --git a/media/admin.py b/media/admin.py index 6c6a07c..23432ec 100644 --- a/media/admin.py +++ b/media/admin.py @@ -9,7 +9,7 @@ from reversion.admin import VersionAdmin from med.admin import admin_site from .forms import MediaAdminForm -from .models import Auteur, Emprunt, Jeu, Media, FutureMedia +from .models import Auteur, Emprunt, FutureMedia, Jeu, Media class AuteurAdmin(VersionAdmin): diff --git a/media/forms.py b/media/forms.py index 224dd0c..2a46052 100644 --- a/media/forms.py +++ b/media/forms.py @@ -41,7 +41,8 @@ class MediaAdminForm(ModelForm): Download data from google books :return True if success """ - api_url = "https://www.googleapis.com/books/v1/volumes?q=ISBN:{}".format(isbn) + api_url = "https://www.googleapis.com/books/v1/volumes?q=ISBN:{}"\ + .format(isbn) with urllib.request.urlopen(api_url) as url: data = json.loads(url.read().decode()) @@ -173,7 +174,8 @@ class MediaAdminForm(ModelForm): if not scrap_result: # Try with OpenLibrary if not self.download_data_openlibrary(isbn): - self.add_error('isbn', _("This ISBN is not found.")) + self.add_error('isbn', + _("This ISBN is not found.")) return self.cleaned_data if self.cleaned_data['title']: