-
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
[#1715] Added management command to delete expired contact invitations #787
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #787 +/- ##
===========================================
+ Coverage 93.15% 93.17% +0.01%
===========================================
Files 719 721 +2
Lines 24982 25027 +45
===========================================
+ Hits 23273 23318 +45
Misses 1709 1709
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
TimelineLog.objects.create( | ||
timestamp=now.strftime("%Y-%m-%dT%H:%M:%S"), | ||
extra_data={ | ||
"deleted_invitations": invites_info, | ||
}, |
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.
Let's add a message
to extra_data
here so this record means something in the admin list view.
Which is why we don't create TimelineLog objects directly but use one of the helpers from open_inwoner/utils/logentry.py
that add a bit more information in semi-standardized fields (in this case probably system_action()
).
If you want to store more info on it you can add a **kwargs
that adds additional fields to the extra_data
. In this case the extra info should probably have both the inviter and invitee, or the record would not be that useful. (eg: if a user complains their invites disappeared, can we retrieve anything from just the invitee/recipient and a date?)
You could also choose to log per inviter and set them as the user
in the TimelineLog.
src/open_inwoner/accounts/management/commands/delete_invitations.py
Outdated
Show resolved
Hide resolved
src/open_inwoner/accounts/management/commands/delete_invitations.py
Outdated
Show resolved
Hide resolved
7b42015
to
49f0935
Compare
src/open_inwoner/accounts/management/commands/delete_invitations.py
Outdated
Show resolved
Hide resolved
src/open_inwoner/accounts/management/commands/delete_invitations.py
Outdated
Show resolved
Hide resolved
49f0935
to
63549f7
Compare
63549f7
to
b770433
Compare
Taiga #1715