Make script paths work in docker and locally for config_app
This commit is contained in:
parent
d5db3462b9
commit
e9d24dc5ff
26 changed files with 79 additions and 2248 deletions
|
@ -22,7 +22,6 @@ class ApiExceptionHandlingApi(Api):
|
|||
|
||||
@crossdomain(origin='*', headers=CROSS_DOMAIN_HEADERS)
|
||||
def handle_error(self, error):
|
||||
print('HANDLING ERROR IN API')
|
||||
return super(ApiExceptionHandlingApi, self).handle_error(error)
|
||||
|
||||
|
||||
|
@ -38,30 +37,12 @@ def format_date(date):
|
|||
return formatdate(timegm(date.utctimetuple()))
|
||||
|
||||
|
||||
def verify_not_prod(func):
|
||||
@add_method_metadata('enterprise_only', True)
|
||||
@wraps(func)
|
||||
def wrapped(*args, **kwargs):
|
||||
# Verify that we are not running on a production (i.e. hosted) stack. If so, we fail.
|
||||
# This should never happen (because of the feature-flag on SUPER_USERS), but we want to be
|
||||
# absolutely sure.
|
||||
# if app.config['SERVER_HOSTNAME'].find('quay.io') >= 0:
|
||||
# TODO(config_port) fixme
|
||||
if False:
|
||||
logger.error('!!! Super user method called IN PRODUCTION !!!')
|
||||
raise StandardError()
|
||||
|
||||
return func(*args, **kwargs)
|
||||
|
||||
return wrapped
|
||||
|
||||
|
||||
def resource(*urls, **kwargs):
|
||||
def wrapper(api_resource):
|
||||
if not api_resource:
|
||||
return None
|
||||
|
||||
print('registering resource: ', urls)
|
||||
api_resource.registered = True
|
||||
api.add_resource(api_resource, *urls, **kwargs)
|
||||
return api_resource
|
||||
|
|
Reference in a new issue