def before_get(self, args, kwargs): refresh = request.args.get('refresh') if refresh == 'true': refresh_settings() kwargs['id'] = 1 if 'Authorization' in request.headers: _jwt_required(app.config['JWT_DEFAULT_REALM']) if current_user.is_admin or current_user.is_super_admin: self.schema = SettingSchemaAdmin else: self.schema = SettingSchemaNonAdmin else: self.schema = SettingSchemaPublic
def before_get(self, args, kwargs): refresh = request.args.get('refresh') if refresh == 'true': refresh_settings() kwargs['id'] = 1 if 'Authorization' in request.headers: verify_jwt_in_request() if current_user.is_admin or current_user.is_super_admin: self.schema = SettingSchemaAdmin else: self.schema = SettingSchemaNonAdmin else: self.schema = SettingSchemaPublic
def after_patch(self, result): # Update settings cache after PATCH refresh_settings()