-
Notifications
You must be signed in to change notification settings - Fork 1
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
Group expire #111
Group expire #111
Conversation
05b8c42
to
f84b34a
Compare
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.
Overall, the code looks fine and I have tested the expiry.
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.
Thanks @jamesturner246. Looks nice. Just need to make the field required which will probably have a few knock-on effects.
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.
Grand. Thanks @jamesturner246
Description
Automatically prune old expired group memberships.
This change adds an
expiry
datetime field to group membership relations. From here, we can use a django management command, scheduled as a Q task, to prune all instances ofGroupMembership
withexpiration
earlier than the current UTC time.expiration
currently default NULL, so it doesn't break stuff, and NULL means no expiration. You'll need to manually set an expiry time manually in the admin page to test.Currently set to daily expiration checking -- modify your 0007 migration file with something shorter like the following to test it:
Also you'll need to run qcluster manually:
docker compose exec app coldfront qcluster
Tests are added, but I had to add
django_q
to installed apps in conftest.py, else temp db creation fails. Not sure if that's the right way.Dunno who else to add as reviewer.
Fixes #80
Fixes #81
Fixes #91
Type of change
Key checklist
python -m pytest
)python -m sphinx -b html docs docs/build
)pre-commit run --all-files
)Further checks