#167 fallback slide, if the slide does not exist

This commit is contained in:
Oskar Hahn 2012-06-03 09:43:28 +02:00
parent 965b682abc
commit 2e498403cb

View File

@ -39,7 +39,10 @@ def get_slide_from_sid(sid, element=False):
return None
if id is not None:
object = SLIDE[key].model.objects.get(pk=id)
try:
object = SLIDE[key].model.objects.get(pk=id)
except SLIDE[key].DoesNotExist:
return None
if element:
return object
return object.slide()