Closed felixrindt closed 2 years ago
Closing, feel free to reopen and add more context if this still occurs.
Well the behavior hasn't changed. I'd respect your decision to not consider it an issue, although I do think the signal should fire in some way. (I don't see a button to repopen the issue.)
I was going to open a PR putting another signal send after the save()
in create_db_pref()
but I'm somewhat confused by this comment:
The raw_value
is not passed to get_or_create
. Is the comment outdated or am I missing something?
In https://github.com/agateblue/django-dynamic-preferences/blob/4dd668f1b60523c6205b1df653501b8b7ca9023b/dynamic_preferences/managers.py#L155
the
preference_update
signal is only fired when the pref-object already exists in the DB, but it doesn't fire if the value is initially changed from the default setting. I do consider it a bug, because whether the object exists in the DB or the preference returns the default value should be opaque to the API user.I'd suggest to also fire the signal in the
except
block over there, using the preference default asold_value
for the signal.