From 3e2ee93dd82ce20e2613fe3d27c3fb3005b221ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Sun, 19 Feb 2017 22:29:19 +0100 Subject: [PATCH] Rename conf option to YAML_SUBMIT_ALLOWED --- conf/config.py | 2 +- module_build_service/config.py | 4 ++++ module_build_service/views.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/config.py b/conf/config.py index b8ff8a5a..c08b2b2c 100644 --- a/conf/config.py +++ b/conf/config.py @@ -36,7 +36,7 @@ class BaseConfiguration(object): PDC_INSECURE = True PDC_DEVELOP = True SCMURLS = ["git://pkgs.stg.fedoraproject.org/modules/"] - SUBMITTING_YAML = False + YAML_SUBMIT_ALLOWED = False # How often should we resort to polling, in seconds # Set to zero to disable polling diff --git a/module_build_service/config.py b/module_build_service/config.py index 3b906618..6786f7ec 100644 --- a/module_build_service/config.py +++ b/module_build_service/config.py @@ -268,6 +268,10 @@ class Config(object): 'type': list, 'default': [], 'desc': 'Allowed SCM URLs.'}, + 'yaml_submit_allowed': { + 'type': bool, + 'default': False, + 'desc': 'Is it allowed to directly submit modulemd yaml file?'}, 'num_consecutive_builds': { 'type': int, 'default': 0, diff --git a/module_build_service/views.py b/module_build_service/views.py index 372dc8a3..8fa556a7 100644 --- a/module_build_service/views.py +++ b/module_build_service/views.py @@ -98,7 +98,7 @@ class ModuleBuildAPI(MethodView): raise Unauthorized("%s is not in any of %r, only %r" % ( username, conf.allowed_groups, groups)) - if "multipart/form-data" in request.headers.get("Content-Type") and conf.submitting_yaml: + if "multipart/form-data" in request.headers.get("Content-Type") and conf.yaml_submit_allowed: module = self.post_file(username) else: module = self.post_scm(username)