diff options
author | luxagraf <sng@luxagraf.net> | 2012-10-21 22:27:22 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2012-10-21 22:27:22 -0400 |
commit | 6c20194f9ac2347c4618f690c0a6b53ce742bbf0 (patch) | |
tree | dff1ca4c30cdfe82dc27aecfb7447ed0e40f5010 /app/blog/views.py | |
parent | 814bc52d7fea888ef023eba1271e6766d5c43203 (diff) |
fixed bug with settings import in photos. Good lesson in why your excepts need to be specific
Diffstat (limited to 'app/blog/views.py')
-rw-r--r-- | app/blog/views.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/blog/views.py b/app/blog/views.py index bfdc593..02acef4 100644 --- a/app/blog/views.py +++ b/app/blog/views.py @@ -42,7 +42,7 @@ def entry_list(request,page): 'page':page, 'MEDIA_URL': settings.BAKED_MEDIA_URL } - except: + except KeyError: extra_context={'page':page} qs = Entry.objects.filter(status__exact=1).order_by('-pub_date').select_related() return object_list(request, queryset=qs, template_name='archives/writing.html',extra_context=extra_context) @@ -68,7 +68,7 @@ def entry_list_by_area(request,slug,page): try: region = Region.objects.get(slug__exact=slug) qs = Entry.objects.filter(status__exact=1,region = region).order_by('-pub_date') - except: + except KeyError: region = Country.objects.get(slug__exact=slug) qs = Entry.objects.filter(status__exact=1,location__state__country = region).order_by('-pub_date') if not region: |