Closed Lioscro closed 2 years ago
What are you trying to do that you hit this? I've actually liked our signal use less and less over the years so it could make sense to take a different route.
What are you trying to do that you hit this? I've actually liked our signal use less and less over the years so it could make sense to take a different route.
I'm trying to set up fixtures for staging and local environments, but when the signals are active, django-admin loaddata
fails because the signal tries to access the actual scripts, which don't exist.
Seems like a good fix, thanks!
This PR adds functionality to disable
pre_save
andpost_save
signals when theraw
keyword argument isTrue
, which is the case when fixtures are being loaded via theloaddata
Django admin command.This makes it overall easier to set up fixtures and seed the database for local development. If the signals are not disabled, every time a fixture for a
ScriptVersion
is being loaded, the backend tries to validate the script (which doesn't actually exist as a file on the host).