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

Fix permission-related display issues after club deactivation #715

Merged
merged 9 commits into from
Sep 1, 2024

Conversation

aviupadhyayula
Copy link
Member

@aviupadhyayula aviupadhyayula commented Sep 1, 2024

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.

Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.40%. Comparing base (3e65dfe) to head (1061615).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@@ -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"}}
Copy link
Member Author

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.

@aviupadhyayula aviupadhyayula changed the title Fix caching issues with admin vs non-admin display after deactivation Fix display issues with permissioned and non-permissioned users after club deactivation Sep 1, 2024
@aviupadhyayula aviupadhyayula changed the title Fix display issues with permissioned and non-permissioned users after club deactivation Fix permission-related display issues after club deactivation Sep 1, 2024
@aviupadhyayula aviupadhyayula merged commit 0b9a9cf into master Sep 1, 2024
9 checks passed
@aviupadhyayula aviupadhyayula deleted the avi/fix-caching-renewal branch September 1, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

1 participant