Fix #928 - cleanup to avoid duplicated get_upload_file_limits
Signed-off-by: Loic Dachary <loic@dachary.org>
This commit is contained in:
committed by
Boris Bobrov
parent
d5421cc366
commit
6c0678576a
@@ -85,8 +85,6 @@ def addmedia(args):
|
||||
print("Can't find a file with filename '%s'" % args.filename)
|
||||
return
|
||||
|
||||
upload_limit, max_file_size = get_upload_file_limits(user)
|
||||
|
||||
def maybe_unicodeify(some_string):
|
||||
# this is kinda terrible
|
||||
if some_string is None:
|
||||
@@ -103,8 +101,7 @@ def addmedia(args):
|
||||
title=maybe_unicodeify(args.title),
|
||||
description=maybe_unicodeify(args.description),
|
||||
license=maybe_unicodeify(args.license),
|
||||
tags_string=maybe_unicodeify(args.tags) or u"",
|
||||
upload_limit=upload_limit, max_file_size=max_file_size)
|
||||
tags_string=maybe_unicodeify(args.tags) or u"")
|
||||
except FileUploadLimit:
|
||||
print("This file is larger than the upload limits for this site.")
|
||||
except UserUploadLimit:
|
||||
|
||||
@@ -73,7 +73,6 @@ def batchaddmedia(args):
|
||||
username=args.username)))
|
||||
return
|
||||
|
||||
upload_limit, max_file_size = get_upload_file_limits(user)
|
||||
temp_files = []
|
||||
|
||||
if os.path.isfile(args.metadata_path):
|
||||
@@ -87,7 +86,6 @@ def batchaddmedia(args):
|
||||
|
||||
abs_metadata_filename = os.path.abspath(metadata_path)
|
||||
abs_metadata_dir = os.path.dirname(abs_metadata_filename)
|
||||
upload_limit, max_file_size = get_upload_file_limits(user)
|
||||
|
||||
def maybe_unicodeify(some_string):
|
||||
# this is kinda terrible
|
||||
@@ -159,8 +157,7 @@ FAIL: Local file {filename} could not be accessed.
|
||||
description=maybe_unicodeify(description),
|
||||
license=maybe_unicodeify(license),
|
||||
metadata=json_ld_metadata,
|
||||
tags_string=u"",
|
||||
upload_limit=upload_limit, max_file_size=max_file_size)
|
||||
tags_string=u"")
|
||||
print(_(u"""Successfully submitted {filename}!
|
||||
Be sure to look at the Media Processing Panel on your website to be sure it
|
||||
uploaded successfully.""".format(filename=filename)))
|
||||
|
||||
Reference in New Issue
Block a user