made no upload limit the default
authorRodney Ewing <ewing.rj@gmail.com>
Thu, 13 Jun 2013 23:41:13 +0000 (16:41 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Mon, 26 Aug 2013 13:33:29 +0000 (06:33 -0700)
mediagoblin/config_spec.ini
mediagoblin/submit/views.py

index 1b9945c524cad7addb62d4ce46c4237afd419ee0..acefa5cc1135d79ef9527d9501e5d311826af469 100644 (file)
@@ -75,8 +75,8 @@ theme = string()
 plugin_web_path = string(default="/plugin_static/")
 plugin_linked_assets_dir = string(default="%(here)s/user_dev/plugin_static/")
 
-# User upload limit (in Mb)
-upload_limit = integer(default=500)
+# Default user upload limit (in Mb)
+#upload_limit = integer(default=500)
 
 [jinja2]
 # Jinja2 supports more directives than the minimum required by mediagoblin. 
index cba9c8b478610041419f480337f2485182daf95b..1a67486b0cea3c0afe5091f3e38bd8deccb95f9c 100644 (file)
@@ -47,9 +47,9 @@ def submit_start(request):
     if user.upload_limit >= 0:
         upload_limit = user.upload_limit
     else:
-        upload_limit = mg_globals.app_config['upload_limit']
+        upload_limit = mg_globals.app_config.get('upload_limit', None)
 
-    if user.uploaded >= upload_limit:
+    if upload_limit and user.uploaded >= upload_limit:
         messages.add_message(
             request,
             messages.WARNING,
@@ -106,7 +106,7 @@ def submit_start(request):
                 file_size = float('{0:.2f}'.format(file_size))
 
                 # Check if user is over upload limit
-                if (user.uploaded + file_size) >= upload_limit:
+                if upload_limit and (user.uploaded + file_size) >= upload_limit:
                     messages.add_message(
                         request,
                         messages.WARNING,