fix error if production does not have script
This commit is contained in:
parent
03e4db0578
commit
df39a4b2b7
|
@ -497,8 +497,12 @@ class Production(ItfModel):
|
||||||
|
|
||||||
def get_dict(self):
|
def get_dict(self):
|
||||||
from events.models import Event
|
from events.models import Event
|
||||||
rel_level1 = [obj for obj in Production.objects.filter(script=self.script)]
|
if self.script:
|
||||||
rel_level2 = list(set(obj.production_set.all() for obj in self.script.related_scripts.all()))
|
rel_level1 = [obj for obj in Production.objects.filter(script=self.script)]
|
||||||
|
rel_level2 = list(set(obj.production_set.all() for obj in self.script.related_scripts.all()))
|
||||||
|
else:
|
||||||
|
rel_level1 = []
|
||||||
|
rel_level2 = []
|
||||||
shows = Event.objects.filter(production=self).order_by('-start_date')
|
shows = Event.objects.filter(production=self).order_by('-start_date')
|
||||||
last_date = None
|
last_date = None
|
||||||
if shows.count() > 0:
|
if shows.count() > 0:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user