Commit dbc84a50 authored by Marko Kuder's avatar Marko Kuder
Browse files

support override of upload size limit (with downloadall plugin)

parent e4457efb
......@@ -240,8 +240,8 @@ def opsi_action_resource_create(context, data_dict):
## Get out resource_id resource from model as it will not appear in
## package_show until after commit
upload.upload(new_resource_id,
uploader.get_max_resource_size())
resource_size_limit = context.get('max_resource_size', 16*1024*1024*1024) if context.get('is_local') else uploader.get_max_resource_size()
upload.upload(new_resource_id, resource_size_limit)
model.repo.commit()
......
......@@ -130,7 +130,8 @@ def opsi_action_resource_update(context, data_dict):
errors = e.error_dict['additional_resources'][m]
raise ValidationError(errors)
upload.upload(id, uploader.get_max_resource_size())
resource_size_limit = context.get('max_resource_size', 16*1024*1024*1024) if context.get('is_local') else uploader.get_max_resource_size()
upload.upload(id, resource_size_limit)
model.repo.commit()
return _get_action('resource_show')(context, {'id': id})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment