Add URL to find episode by submission ID
This commit is contained in:
parent
7481f245fd
commit
da82bddd05
@ -41,6 +41,7 @@ urlpatterns = [
|
|||||||
url(r'^season/(?P<season>\d{1,4})/append$', views.EpisodeSubmitForm),
|
url(r'^season/(?P<season>\d{1,4})/append$', views.EpisodeSubmitForm),
|
||||||
url(r'^submission/(?P<submission>\d{1,4})/moderate$', views.SubmissionModForm),
|
url(r'^submission/(?P<submission>\d{1,4})/moderate$', views.SubmissionModForm),
|
||||||
url(r'^submission/(?P<submission>\d{1,4})/report$', views.ReportSubmission),
|
url(r'^submission/(?P<submission>\d{1,4})/report$', views.ReportSubmission),
|
||||||
|
url(r'^episode/by-submission/(?P<submission>\d{1,4})$', views.EpisodeFindSubmission),
|
||||||
url(r'^episode/(?P<season>\d{1,4})/(?P<episode>\d{1,4})(-[\w-]+)?/?$', views.EpisodeView.as_view()),
|
url(r'^episode/(?P<season>\d{1,4})/(?P<episode>\d{1,4})(-[\w-]+)?/?$', views.EpisodeView.as_view()),
|
||||||
url(r'^episode/(?P<season>\d{1,4})/(?P<episode>\d{1,4})(-[\w-]+)?/submit$', views.SubmissionForm),
|
url(r'^episode/(?P<season>\d{1,4})/(?P<episode>\d{1,4})(-[\w-]+)?/submit$', views.SubmissionForm),
|
||||||
url(r'^vote/(?P<subid>\d+)/(?P<positive>[0-1])/?$', views.SubmissionVoteSubmit.as_view())
|
url(r'^vote/(?P<subid>\d+)/(?P<positive>[0-1])/?$', views.SubmissionVoteSubmit.as_view())
|
||||||
|
@ -90,6 +90,14 @@ class EpisodeView(TemplateView):
|
|||||||
|
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
def EpisodeFindSubmission(req, abbr, submission):
|
||||||
|
show = get_object_or_404(Show, abbr=abbr)
|
||||||
|
submission = int(submission)
|
||||||
|
|
||||||
|
episode = get_object_or_404(Episode, submissions__id=submission)
|
||||||
|
|
||||||
|
return HttpResponseRedirect('/show/%s/episode/%d/%d?submission=%d'%(abbr, episode.season.number, episode.episode, submission))
|
||||||
|
|
||||||
# Submission form GET and POST
|
# Submission form GET and POST
|
||||||
@login_required
|
@login_required
|
||||||
def SubmissionForm(req, abbr, season, episode):
|
def SubmissionForm(req, abbr, season, episode):
|
||||||
|
Reference in New Issue
Block a user