Skip to content

Commit

Permalink
fix: waffle flags in flask context (CenterForOpenScience#10664)
Browse files Browse the repository at this point in the history
* fix: waffle flags in flask context
  • Loading branch information
aaxelb authored and Jon Walz committed Jul 25, 2024
1 parent 104ff63 commit 1f2c93a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions osf/models/metaschema.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.db import models
import waffle
from jsonschema import validate, ValidationError as JsonSchemaValidationError, SchemaError, Draft7Validator

from website.util import api_v2_url

from .base import BaseModel, ObjectIDMixin
from .validators import RegistrationResponsesValidator
from api.waffle.utils import flag_is_active
from osf.utils.datetime_aware_jsonfield import DateTimeAwareJSONField
from osf.exceptions import ValidationValueError, ValidationError

Expand Down Expand Up @@ -34,7 +35,7 @@ def allow_egap_admins(queryset, request):
Allows egap admins to see EGAP registrations as visible, should be deleted when when the EGAP registry goes
live.
"""
if hasattr(request, 'user') and not waffle.flag_is_active(request, EGAP_ADMINS):
if hasattr(request, 'user') and not flag_is_active(request, EGAP_ADMINS):
return queryset.exclude(name='EGAP Registration')
return queryset

Expand Down
2 changes: 0 additions & 2 deletions osf/models/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import markupsafe
import logging

import waffle

from django.apps import apps
from django.contrib.auth.models import Group, AnonymousUser
from django.core.exceptions import ObjectDoesNotExist, ValidationError
Expand Down

0 comments on commit 1f2c93a

Please sign in to comment.