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']: