mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-03-16 22:20:28 +00:00
Appease flake8.
This commit is contained in:
parent
49fc6c47ff
commit
bc206765fa
4 changed files with 6 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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...
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ def get_cache_backend():
|
|||
signals.request_finished.connect(cache.close)
|
||||
return cache
|
||||
|
||||
|
||||
cache = get_cache_backend()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue