def post(self): config_json = json.loads(request.data) if config_json.has_key('reset'): ConfigService.reset_config() else: ConfigService.update_config(config_json, should_encrypt=True) return self.get()
def post(self): config_json = json.loads(request.data) if 'reset' in config_json: ConfigService.reset_config() else: if not ConfigService.update_config(config_json, should_encrypt=True): abort(400) return self.get()