Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib doesn't work with JSON serialized cache #410

Open
striveforbest opened this issue Sep 20, 2021 · 0 comments
Open

Lib doesn't work with JSON serialized cache #410

striveforbest opened this issue Sep 20, 2021 · 0 comments

Comments

@striveforbest
Copy link

I am using django-redis as my cache backend:

    CACHES = values.DictValue({
        'default': {
            'BACKEND': 'django_redis.cache.RedisCache',
            'OPTIONS': {
                'CLIENT_CLASS': 'django_redis.client.DefaultClient',
                'COMPRESSOR': 'django_redis.compressors.zlib.ZlibCompressor',
                'SERIALIZER': 'django_redis.serializers.json.JSONSerializer',
            }
        }
    })

Trying to use the following piece of code:

        if not flag_is_active(request, 'dashboard'):
            return redirect('product-list')

and tracing it down to waffle.models get method on line 36 (https://github.com/django-waffle/django-waffle/blob/51659117a25b97a59d96970a325c462499f33b15/waffle/models.py#L51)

Getting this error:

TypeError: Object of type FeatureFlag is not JSON serializable

Which makes sense. Any recommendation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant