-
Notifications
You must be signed in to change notification settings - Fork 350
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
Custom command ignoring tenant #114
Comments
So I found the cause, for some reason when I cause a exception on the database side, let's say an Integrity Error which raises a New attribute of the
and inside _cursor() validation of
|
@perrohunter Thank you I will have a look at the pull request |
Merged |
Hi, I'm writing a custom command and I'm realizing that even if I specify a
--schema
when running the custom command withtenant_command
some times I'm getting error:I've notice that this happens when I'm trying to access a
tenant
app and suddenly some models are not properly tenant configured and throw the error.Any away I can ensure the right schema is properly configured?
This only happens when running code through a
tenant_command
where I'm loading modules dynamically and one of them causes an exception.My Logic:
run
./manage.py tenant_command demodata
my
demodata
command looks through all the django applications, find the ones containing ademo
folder and loads each file in it the calls ainstall()
method sample gistdemodata
command files two filescats.py
anddogs.py
, it loads them and then calls a method first oncats.py
thendogs.py
cats.py fails with an exception "integrity bla bla, duplicate key" so far, everything is as expected
dogs.py gets run and upon executing the first db query
Dogs.objects.filter(goodBoy=True)
it fails withthis is a really weird scenario, if no exception is caused by
cats.py
thendogs.py
runs just fineThe text was updated successfully, but these errors were encountered: