diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-10 21:03:16 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-10 21:03:16 -0500 |
commit | f64e5250906401a3d5a5fc587521bc31e146859c (patch) | |
tree | 3e2a8806a3ccaa265df7fc40815b31184e77d5e0 | |
parent | 6d794f268bb1f5d3cc56c5f0dc902571d48ebeac (diff) | |
download | mediagoblin-f64e5250906401a3d5a5fc587521bc31e146859c.tar.lz mediagoblin-f64e5250906401a3d5a5fc587521bc31e146859c.tar.xz mediagoblin-f64e5250906401a3d5a5fc587521bc31e146859c.zip |
Generate the ObjectId() manually instead of via .save()
-rw-r--r-- | mediagoblin/submit/views.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index ba13b755..a3a58400 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -20,6 +20,7 @@ from string import split from werkzeug.utils import secure_filename +from mediagoblin.db.util import ObjectId from mediagoblin.util import ( render_to_response, redirect, cleaned_markdown_conversion, \ convert_to_tag_list_of_dicts) @@ -51,6 +52,7 @@ def submit_start(request): # create entry and save in database entry = request.db.MediaEntry() + entry['_id'] = ObjectId() entry['title'] = ( request.POST['title'] or unicode(splitext(filename)[0])) @@ -66,10 +68,6 @@ def submit_start(request): entry['tags'] = convert_to_tag_list_of_dicts( request.POST.get('tags')) - # Save, just so we can get the entry id for the sake of using - # it to generate the file path - entry.save(validate=False) - # Generate a slug from the title entry.generate_slug() |