Merge branch 'master' into processing
This commit is contained in:
commit
1b57c29082
@ -20,6 +20,7 @@ from string import split
|
|||||||
|
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
|
from mediagoblin.db.util import ObjectId
|
||||||
from mediagoblin.util import (
|
from mediagoblin.util import (
|
||||||
render_to_response, redirect, cleaned_markdown_conversion, \
|
render_to_response, redirect, cleaned_markdown_conversion, \
|
||||||
convert_to_tag_list_of_dicts)
|
convert_to_tag_list_of_dicts)
|
||||||
@ -51,6 +52,7 @@ def submit_start(request):
|
|||||||
|
|
||||||
# create entry and save in database
|
# create entry and save in database
|
||||||
entry = request.db.MediaEntry()
|
entry = request.db.MediaEntry()
|
||||||
|
entry['_id'] = ObjectId()
|
||||||
entry['title'] = (
|
entry['title'] = (
|
||||||
request.POST['title']
|
request.POST['title']
|
||||||
or unicode(splitext(filename)[0]))
|
or unicode(splitext(filename)[0]))
|
||||||
@ -66,10 +68,6 @@ def submit_start(request):
|
|||||||
entry['tags'] = convert_to_tag_list_of_dicts(
|
entry['tags'] = convert_to_tag_list_of_dicts(
|
||||||
request.POST.get('tags'))
|
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
|
# Generate a slug from the title
|
||||||
entry.generate_slug()
|
entry.generate_slug()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user