-
Notifications
You must be signed in to change notification settings - Fork 411
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(webhook/signal): Optimise historical record writes #5041
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
for more information, see https://pre-commit.ci
Uffizzi Ephemeral Environment
|
2c01365
to
e52153c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5041 +/- ##
==========================================
- Coverage 97.40% 97.39% -0.01%
==========================================
Files 1193 1193
Lines 41675 41717 +42
==========================================
+ Hits 40593 40632 +39
- Misses 1082 1085 +3 ☔ View full report in Codecov by Sentry. |
@@ -134,6 +135,18 @@ def schedule_hubspot_tracking(self) -> None: | |||
), | |||
) | |||
|
|||
@hook(AFTER_SAVE, condition=(WhenFieldHasChanged("email", has_changed=True))) | |||
def send_warning_email(self): | |||
from users.tasks import send_email_changed_notification_email |
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.
We can certainly get rid of this local import by doing some refactoring, but I will create a different pull request for that to avoid polluting this one
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.
I'm so used to importing tasks this way I regard it basically as a pattern now.
Globally, we could think on implementing a task dispatcher that accepts a string and does this under the hood so the task users don't have to.
Docker builds report
|
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
HistoricalRecords
to not write~
historical records on soft deleteget_skip_create_audit_log
to the signal method to avoid creating tasks that don't do anytingSegmentRule
django-lifecycle
to support more complex hook conditionsHow did you test this code?
Adds and updates unit tests