aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/submit/views.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2013-05-21 00:28:37 +0200
committerElrond <elrond+mediagoblin.org@samba-tng.org>2013-05-21 00:28:37 +0200
commit6c1467d570a4da68ef8b4edac9aecdb9c87a61de (patch)
tree00788a32b50738c701fd5150e773204e389bd5a2 /mediagoblin/submit/views.py
parent4adc3a85dda878b40f44e07b2283d4c55c6c5d02 (diff)
downloadmediagoblin-6c1467d570a4da68ef8b4edac9aecdb9c87a61de.tar.lz
mediagoblin-6c1467d570a4da68ef8b4edac9aecdb9c87a61de.tar.xz
mediagoblin-6c1467d570a4da68ef8b4edac9aecdb9c87a61de.zip
Refactor submit util new_upload_entry
This tool creates an initial media entry for a given user. No magic. It just prefills the license with the user's default license and adds the user as uploader.
Diffstat (limited to 'mediagoblin/submit/views.py')
-rw-r--r--mediagoblin/submit/views.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py
index e964ec12..a70c89b4 100644
--- a/mediagoblin/submit/views.py
+++ b/mediagoblin/submit/views.py
@@ -32,7 +32,7 @@ from mediagoblin.messages import add_message, SUCCESS
from mediagoblin.media_types import sniff_media, \
InvalidFileType, FileTypeNotSupported
from mediagoblin.submit.lib import check_file_field, prepare_queue_task, \
- run_process_media
+ run_process_media, new_upload_entry
@require_active_login
@@ -57,7 +57,7 @@ def submit_start(request):
request.files['file'])
# create entry and save in database
- entry = request.db.MediaEntry()
+ entry = new_upload_entry(request.user)
entry.media_type = unicode(media_type)
entry.title = (
unicode(submit_form.title.data)
@@ -67,8 +67,6 @@ def submit_start(request):
entry.license = unicode(submit_form.license.data) or None
- entry.uploader = request.user.id
-
# Process the user's folksonomy "tags"
entry.tags = convert_to_tag_list_of_dicts(
submit_form.tags.data)