aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-08-08 15:49:33 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-08-08 15:49:33 -0700
commitb26edfb944a02bbb3b1a326c536c10fce6e7bb03 (patch)
tree190893e5f81a319b313727e6fb0baadf6b8d39c6
parent4de7db6fefa17c5c87b07c7aeccb098b9ec403b2 (diff)
downloadmediagoblin-b26edfb944a02bbb3b1a326c536c10fce6e7bb03.tar.lz
mediagoblin-b26edfb944a02bbb3b1a326c536c10fce6e7bb03.tar.xz
mediagoblin-b26edfb944a02bbb3b1a326c536c10fce6e7bb03.zip
Revert "Leave slug empty until we are sure media processing was successful."
This reverts commit f67611fb485b5a84cedc62b73beb1e551e8cb934. For some reason, generating a slug here throws an integrity error during a query when there is a duplicate slug.
-rw-r--r--mediagoblin/plugins/api/views.py2
-rw-r--r--mediagoblin/processing/task.py2
-rw-r--r--mediagoblin/submit/views.py3
3 files changed, 5 insertions, 2 deletions
diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py
index 0e8735bc..9159fe65 100644
--- a/mediagoblin/plugins/api/views.py
+++ b/mediagoblin/plugins/api/views.py
@@ -61,6 +61,8 @@ def post_entry(request):
entry.description = unicode(request.form.get('description'))
entry.license = unicode(request.form.get('license', ''))
+ entry.generate_slug()
+
# queue appropriately
queue_file = prepare_queue_task(request.app, entry, media_file.filename)
diff --git a/mediagoblin/processing/task.py b/mediagoblin/processing/task.py
index ba2323b2..9af192ed 100644
--- a/mediagoblin/processing/task.py
+++ b/mediagoblin/processing/task.py
@@ -94,8 +94,6 @@ class ProcessMedia(task.Task):
# 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 ;)
entry.state = u'processed'
- #Generate the slug here rather than earlier when it could have failed.
- entry.generate_slug()
entry.save()
# Notify the PuSH servers as async task
diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py
index b2629bb5..3f9d5b2d 100644
--- a/mediagoblin/submit/views.py
+++ b/mediagoblin/submit/views.py
@@ -78,6 +78,9 @@ def submit_start(request):
entry.tags = convert_to_tag_list_of_dicts(
submit_form.tags.data)
+ # Generate a slug from the title
+ entry.generate_slug()
+
queue_file = prepare_queue_task(request.app, entry, filename)
with queue_file: