wait for poster

This commit is contained in:
j 2013-02-25 11:14:04 +00:00
parent 8734e35613
commit c089551e08

View file

@ -7,7 +7,6 @@ import random
from urlparse import urlparse from urlparse import urlparse
from urllib import quote from urllib import quote
import time import time
import re
import Image import Image
from django.db.models import Count, Sum from django.db.models import Count, Sum
@ -483,7 +482,11 @@ def add(request):
i = models.Item() i = models.Item()
i.data['title'] = data['title'] i.data['title'] = data['title']
i.user = request.user i.user = request.user
i.save() p = i.save()
if p:
p.wait()
else:
i.make_poster(True)
response = json_response(status=200, text='created') response = json_response(status=200, text='created')
response['data'] = i.get_json() response['data'] = i.get_json()
return render_to_json_response(response) return render_to_json_response(response)