jazzband / django-waffle

A feature flipper for Django
https://waffle.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.12k stars 258 forks source link

TypeError: is_active() got an unexpected keyword argument 'read_only' #474

Open cclauss opened 1 year ago

cclauss commented 1 year ago

I am upgrading from django-waffle==0.19.0 to current django-waffle on Django 3.1. I am getting the above TypeError which seems to be related to the changes made in #447. Are there any hints on how to modify existing code the deal with the read_only change?

clintonb commented 1 year ago

@cclauss can you share a stack trace, please?

rossasarus commented 1 year ago

@cclauss Did you ever resolve this? I'm hitting the same thing.

cclauss commented 1 year ago

This fix worked for me but unfortunately, it is not an open source project so I cannot add any further details...

flags/models.py: Add a read_only parameter to is_active() to support modern versions of django-waffle.

-    def is_active(self, request):
+    def is_active(self, request, read_only=False):