Leave slug empty until we are sure media processing was successful.
Patch submitted by LotusEcho
This commit is contained in:
parent
155d234d95
commit
f67611fb48
@ -61,8 +61,6 @@ def post_entry(request):
|
|||||||
entry.description = unicode(request.form.get('description'))
|
entry.description = unicode(request.form.get('description'))
|
||||||
entry.license = unicode(request.form.get('license', ''))
|
entry.license = unicode(request.form.get('license', ''))
|
||||||
|
|
||||||
entry.generate_slug()
|
|
||||||
|
|
||||||
# queue appropriately
|
# queue appropriately
|
||||||
queue_file = prepare_queue_task(request.app, entry, media_file.filename)
|
queue_file = prepare_queue_task(request.app, entry, media_file.filename)
|
||||||
|
|
||||||
|
@ -94,6 +94,8 @@ class ProcessMedia(task.Task):
|
|||||||
# We set the state to processed and save the entry here so there's
|
# We set the state to processed and save the entry here so there's
|
||||||
# no need to save at the end of the processing stage, probably ;)
|
# no need to save at the end of the processing stage, probably ;)
|
||||||
entry.state = u'processed'
|
entry.state = u'processed'
|
||||||
|
#Generate the slug here rather than earlier when it could have failed.
|
||||||
|
entry.generate_slug()
|
||||||
entry.save()
|
entry.save()
|
||||||
|
|
||||||
# Notify the PuSH servers as async task
|
# Notify the PuSH servers as async task
|
||||||
|
@ -78,9 +78,6 @@ def submit_start(request):
|
|||||||
entry.tags = convert_to_tag_list_of_dicts(
|
entry.tags = convert_to_tag_list_of_dicts(
|
||||||
submit_form.tags.data)
|
submit_form.tags.data)
|
||||||
|
|
||||||
# Generate a slug from the title
|
|
||||||
entry.generate_slug()
|
|
||||||
|
|
||||||
queue_file = prepare_queue_task(request.app, entry, filename)
|
queue_file = prepare_queue_task(request.app, entry, filename)
|
||||||
|
|
||||||
with queue_file:
|
with queue_file:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user