-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix permission-related display issues after club deactivation #715
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #715 +/- ##
==========================================
+ Coverage 71.29% 71.40% +0.10%
==========================================
Files 31 31
Lines 6842 6850 +8
==========================================
+ Hits 4878 4891 +13
+ Misses 1964 1959 -5 ☔ View full report in Codecov by Sentry. |
@@ -11,7 +11,7 @@ | |||
TEST_OUTPUT_DIR = "test-results" | |||
|
|||
# Use dummy cache for testing | |||
CACHES = {"default": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"}} | |||
CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caching was effectively turned off in CI/CD tests -- not sure what the original intention was, but I'm reverting it back. We interact with the cache manually in a lot of our views, so feels reasonable that the unit tests also check its correctness.
Deactivated clubs are displayed differently to permissioned vs non-permissioned users. Users without permissions are expected to see the last approved version; users with permissions see the most up-to-date version. Currently, caching in the viewset incorrect caches the non-permissioned state and displays it to permissioned users. This leads to approval messages showing up in the club management dashboard, despite the club not being approved.
This PR adds a test to check this case (should fail with current code), and adds a fix. It also turns on caching in CI.