From: Radek Czajka Date: Sat, 16 Feb 2019 23:16:11 +0000 (+0100) Subject: Passing for Django 1.11. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/b0b9c1f0f9f4cc0f5c4d00d913735ab6a81bf214?ds=inline;hp=64af15fe792f42d3a7dc3e857a45577d16806255 Passing for Django 1.11. --- diff --git a/requirements/requirements.txt b/requirements/requirements.txt index f9374c3b9..ed0ee1605 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,16 +1,16 @@ -i https://py.mdrn.pl/simple/ # django -Django>=1.10,<1.11 +Django==1.11.20 fnpdjango==0.3 -django-pipeline==1.6.10 +django-pipeline==1.6.13 jsmin fnp-django-pagination==2.2.2 django-maintenancemode==0.10 jsonfield==2.0.2 django-picklefield>=1.0,<1.1 -django-modeltranslation==0.12 -django-allauth>=0.32,<0.33 +django-modeltranslation==0.12.1 +django-allauth==0.38.0 django-extensions==1.7.8 djangorestframework<3.7 djangorestframework-xml @@ -20,7 +20,7 @@ oauthlib>=3.0.1,<3.1 pyyaml polib -django-babel==0.6.0 +django-babel==0.6.1 pytz diff --git a/src/opds/views.py b/src/opds/views.py index adfd0730c..004ee5b7d 100644 --- a/src/opds/views.py +++ b/src/opds/views.py @@ -79,13 +79,13 @@ class OPDSFeed(Atom1Feed): _book_parent_img = lazy(lambda: full_url(os.path.join(settings.STATIC_URL, "img/book-parent.png")), str)() try: _book_parent_img_size = unicode(os.path.getsize(os.path.join(settings.STATIC_ROOT, "img/book-parent.png"))) - except IOError: + except OSError: _book_parent_img_size = '' _book_img = lazy(lambda: full_url(os.path.join(settings.STATIC_URL, "img/book.png")), str)() try: _book_img_size = unicode(os.path.getsize(os.path.join(settings.STATIC_ROOT, "img/book.png"))) - except IOError: + except OSError: _book_img_size = '' def add_root_elements(self, handler): diff --git a/src/search/fields.py b/src/search/fields.py index 1dc787016..9572fa3ae 100755 --- a/src/search/fields.py +++ b/src/search/fields.py @@ -3,7 +3,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.forms.widgets import flatatt +from django.forms.utils import flatatt from django.utils.encoding import smart_unicode from django.utils.safestring import mark_safe from json import dumps @@ -18,7 +18,7 @@ class JQueryAutoCompleteWidget(forms.TextInput): return u'$(\'#%s\').autocomplete(%s).result(autocomplete_result_handler);' % (field_id, options) def render(self, name, value=None, attrs=None): - final_attrs = self.build_attrs(attrs, name=name) + final_attrs = self.build_attrs(self.attrs, attrs) if value: final_attrs['value'] = smart_unicode(value) diff --git a/src/wolnelektury/settings/static.py b/src/wolnelektury/settings/static.py index 146e35bae..f6411ccc5 100644 --- a/src/wolnelektury/settings/static.py +++ b/src/wolnelektury/settings/static.py @@ -182,6 +182,7 @@ PIPELINE = { } STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineCachedStorage' +#STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss' # PIPELINE_PYSCSS_ARGUMENTS = '' @@ -190,5 +191,6 @@ STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineCachedStorage' STATICFILES_FINDERS = [ 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'pipeline.finders.CachedFileFinder', 'pipeline.finders.PipelineFinder', ]