diff options
author | Loic Dachary <loic@dachary.org> | 2016-01-28 15:10:03 +0700 |
---|---|---|
committer | Boris Bobrov <breton@cynicmansion.ru> | 2016-07-25 03:48:33 +0300 |
commit | 6c0678576aa64251b5a34e04541d4cfd36811f2e (patch) | |
tree | 27a6c32b633a006017b71121732b8e70032e3079 /mediagoblin/gmg_commands | |
parent | d5421cc3666ac0e5802bd9a6e806dca5534d3a88 (diff) | |
download | mediagoblin-6c0678576aa64251b5a34e04541d4cfd36811f2e.tar.lz mediagoblin-6c0678576aa64251b5a34e04541d4cfd36811f2e.tar.xz mediagoblin-6c0678576aa64251b5a34e04541d4cfd36811f2e.zip |
Fix #928 - cleanup to avoid duplicated get_upload_file_limits
Signed-off-by: Loic Dachary <loic@dachary.org>
Diffstat (limited to 'mediagoblin/gmg_commands')
-rw-r--r-- | mediagoblin/gmg_commands/addmedia.py | 5 | ||||
-rw-r--r-- | mediagoblin/gmg_commands/batchaddmedia.py | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/mediagoblin/gmg_commands/addmedia.py b/mediagoblin/gmg_commands/addmedia.py index 8cbfc806..9685d5a5 100644 --- a/mediagoblin/gmg_commands/addmedia.py +++ b/mediagoblin/gmg_commands/addmedia.py @@ -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: diff --git a/mediagoblin/gmg_commands/batchaddmedia.py b/mediagoblin/gmg_commands/batchaddmedia.py index 2ad7e39e..274d72bc 100644 --- a/mediagoblin/gmg_commands/batchaddmedia.py +++ b/mediagoblin/gmg_commands/batchaddmedia.py @@ -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))) |