Joseph Nuthalapati efbf2a80f5
notifications: Fix setting last_update_time
The field last_update_time is set to auto_now in the Django model, but it is not
being updated when using update_or_create() since Django 4.2. This is because it
sends update_fields= argument to save().

Say, a user installed an app a few hours ago and uninstalls it now, the
notification should be updated to show the uninstallation status but it shows
the timestamp of the installation instead.

Explicitly setting the updated timestamp is one way of fixing this issue.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Use django_db mark in test case]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2025-07-10 16:05:47 -07:00
..