Skip to content
Browse files

episode sequence sane default

  • Loading branch information...
1 parent df4bde5 commit ee2fdcdf32d7934202267f0baa81eca092ba93e4 @CarlFK committed Jul 27, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 dj/main/views.py
View
12 dj/main/views.py
@@ -797,10 +797,15 @@ def episodes(request, client_slug=None, show_slug=None, location_slug=None,
episode = form.save()
# setup next form
# use saved Episode as a base for defaults
+ if episode.sequence is None:
+ sequence=2
+ else:
+ print episode.sequence
+ sequence=episode.sequence+1
inits={
'show':show.id,
'location':episode.location.id,
- 'sequence':episode.sequence+1,
+ 'sequence':sequence,
'start':episode.end,
'duration':episode.duration,
'state':1,
@@ -816,7 +821,10 @@ def episodes(request, client_slug=None, show_slug=None, location_slug=None,
episode = episodes[len(episodes)-1]
print episode
location = episode.location.id
- sequence = episode.sequence+1
+ if episode.sequence is None:
+ sequence = 2
+ else:
+ sequence = episode.sequence+1
start = episode.end
else:
# firt Episode of the show

0 comments on commit ee2fdcd

Please sign in to comment.
Something went wrong with that request. Please try again.