Opened 18 years ago
Closed 18 years ago
#3905 closed (fixed)
app name incorrectly reported in syncdb output
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | syncdb | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
in syncdb(), the app_name variable isn't set in custom SQL installation loop, which can cause incorrect status messages.
Attachments (2)
Change History (8)
by , 18 years ago
Attachment: | core_management_py.patch added |
---|
follow-up: 2 comment:1 by , 18 years ago
comment:2 by , 18 years ago
Replying to mtredinnick:
Under what circumstances does this fail? Can you describe a simple example?
Sorry about the terseness of the original message. It was such a simple fix, I didn't go into much detail. Apologies.
The output is incorrect whenever a custom SQL file exists for an application which isn't the last one listed in INSTALLED_APPS. Try creating a site with two apps, and create an sql file for the first one in the INSTALLED_APPS list. You'll see the output from syncdb shows the application name of the second app instead of the first.
It's easiest to see by just looking at the code--in the syncdb function, there are several loops through models.get_apps(). The first line after all but one sets the app_name variable to the current application name for use in print statements. The loop for installing custom SQL uses the app_name variable, but never updates it.
comment:3 by , 18 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
I've confirmed that this happens, and that the error messages refer to the wrong app (the last app in INSTALLED_APPS). With the patch applied, the correct app name is used. I think this is ready for check-in.
comment:4 by , 18 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:5 by , 18 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Under what circumstances does this fail? Can you describe a simple example?