Appease flake8.

This commit is contained in:
Jannis Leidel 2017-11-22 11:01:02 +01:00
parent 49fc6c47ff
commit bc206765fa
No known key found for this signature in database
GPG key ID: C795956FB489DCA9
4 changed files with 6 additions and 3 deletions

View file

@ -49,6 +49,7 @@ class CodeMirrorTextArea(forms.Textarea):
""" % dict(media_prefix=settings.DBTEMPLATES_MEDIA_PREFIX, name=name))
return mark_safe(u"".join(result))
if settings.DBTEMPLATES_USE_CODEMIRROR:
TemplateContentTextArea = CodeMirrorTextArea
else:
@ -161,4 +162,5 @@ class TemplateAdmin(TemplateModelAdmin):
return ", ".join([site.name for site in template.sites.all()])
site_list.short_description = _('sites')
admin.site.register(Template, TemplateAdmin)

View file

@ -45,7 +45,7 @@ class Loader(BaseLoader):
backend_template = cache.get(cache_key)
if backend_template:
return backend_template, template_name
except:
except Exception:
pass
# Not found in cache, move on.
@ -55,7 +55,7 @@ class Loader(BaseLoader):
notfound = cache.get(cache_notfound_key)
if notfound:
raise TemplateDoesNotExist(template_name)
except:
except Exception:
raise TemplateDoesNotExist(template_name)
# Not marked as not-found, move on...

View file

@ -60,7 +60,7 @@ class Command(BaseCommand):
try:
site = Site.objects.get_current()
except:
except Exception:
raise CommandError("Please make sure to have the sites contrib "
"app installed and setup with a site object")

View file

@ -17,6 +17,7 @@ def get_cache_backend():
signals.request_finished.connect(cache.close)
return cache
cache = get_cache_backend()