MCPcopy Index your code
hub / github.com/bugy/script-server / put

Method put

src/web/server.py:163–175  ·  view source on GitHub ↗
(self, user)

Source from the content-addressed store, hash-verified

161 @requires_admin_rights
162 @inject_user
163 def put(self, user):
164 (config, filename, uploaded_script) = self.read_config_parameters()
165
166 try:
167 self.application.config_service.update_config(user, config, filename, uploaded_script)
168 except (InvalidConfigException, InvalidFileException) as e:
169 raise tornado.web.HTTPError(422, str(e))
170 except ConfigNotAllowedException:
171 LOGGER.warning('Admin access to the script "' + config['name'] + '" is denied for ' + user.get_audit_name())
172 respond_error(self, 403, 'Access to the script is denied')
173 return
174 except InvalidAccessException as e:
175 raise tornado.web.HTTPError(403, reason=str(e))
176
177 def read_config_parameters(self):
178 config = json.loads(self.get_argument('config'))

Callers 1

Calls 4

respond_errorFunction · 0.90
update_configMethod · 0.80
get_audit_nameMethod · 0.45

Tested by 1