Exemple #1
0
    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
Exemple #2
0
    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
Exemple #3
0
 def after_patch(self, result):
     # Update settings cache after PATCH
     refresh_settings()
 def after_patch(self, result):
     # Update settings cache after PATCH
     refresh_settings()