dont fail on unknown Ox ids

This commit is contained in:
j 2010-09-17 19:26:47 +02:00
parent 47c821c34a
commit 23ab4260ed
3 changed files with 9 additions and 1 deletions

3
README
View file

@ -23,3 +23,6 @@ Install rabbitmq and carrot:
sudo rabbitmqctl set_permissions -p /oxdata oxdata ".*" ".*" ".*" sudo rabbitmqctl set_permissions -p /oxdata oxdata ".*" ".*" ".*"
Deploy:
adduser --disabled-password --disabled-login --home /srv/oxdata/ oxdata

View file

@ -16,7 +16,10 @@ def get_movie_id(request):
if len(movieId) == 7: if len(movieId) == 7:
movie_id = models.getMovieIdByImdbId(imdb_id=movieId) movie_id = models.getMovieIdByImdbId(imdb_id=movieId)
else: else:
try:
movie_id = models.MovieId.objects.get(oxdb_id=movieId) movie_id = models.MovieId.objects.get(oxdb_id=movieId)
except models.MovieId.DoesNotExist:
movie_id = None
if 'imdb' in request.GET: if 'imdb' in request.GET:
movieId = request.GET['imdb'] movieId = request.GET['imdb']
movie_id = models.getMovieIdByImdbId(imdb_id=movieId) movie_id = models.getMovieIdByImdbId(imdb_id=movieId)

View file

@ -2,4 +2,6 @@
South South
-e bzr+http://code.0x2620.org/python-oxdjango/#egg=python-oxdjango -e bzr+http://code.0x2620.org/python-oxdjango/#egg=python-oxdjango
-e bzr+http://code.0x2620.org/python-ox/#egg=python-ox -e bzr+http://code.0x2620.org/python-ox/#egg=python-ox
chardet
django-celery django-celery
gunicorn