Open gabrielbiasi opened 6 years ago
I suggest to check if raw=False
when catching the post_save signal in order to ignore actions made in loaddata call.
Sounds sensible, although it would require running a manual buildwatson command after using loaddata.
I'd take a pull request for this.
On 11 September 2018 at 20:45, Gabriel de Biasi notifications@github.com wrote:
I suggest to check if raw=False when catching the post_save signal in order to ignore actions made in loaddata call.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/250#issuecomment-420400028, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJFCAbMrcbXT8W9HtYgBU2azH3HRu9Dks5uaBL1gaJpZM4WkF8Z .
I will appreciate this. Thank you for your time.
Sounds sensible, although it would require running a manual buildwatson command after using loaddata. I'd take a pull request for this.
I made a workaround for this, using an environment variable.
NOINDEX=1 python manage.py loaddata */fixtures/*.json
And in apps.py
:
if 'NOINDEX' not in os.environ: watson.register(self.get_model('MyModel'))
After that, I call buildwatson
.
One of my models has "db-related" url. When I call
get_absolute_url
will hit the database.When I use loaddata to load a dump of my app, watson already tries to use the object and hit the
get_absolute_url
method, resulting in a "matching query does not exist" and stop all the process.Is there a way to tell watson to not try anything during a loaddata call?
Resulting trace: