dont return json 404 for non existing old ids

This commit is contained in:
j 2013-12-25 10:11:21 +00:00
parent 1ac95407f8
commit 2ff13690f8

View file

@ -4,6 +4,8 @@ import re
from django.shortcuts import get_object_or_404, redirect
import app.views
import models
def padma_find(request):
@ -49,11 +51,17 @@ def padma_video(request, url):
layer = view
view = None
if layer:
try:
alias = get_object_or_404(models.LayerAlias, old=layer)
url = '/%s' % alias.new
except:
return app.views.index(request)
else:
try:
alias = get_object_or_404(models.IDAlias, old=hid)
url = '/%s' % alias.new
except:
return app.views.index(request)
if view:
timecodes = re.compile('(\d{2}:\d{2}:\d{2}\.\d{3})-(\d{2}:\d{2}:\d{2}\.\d{3})').findall(view)
if timecodes: