Opened 17 years ago

Closed 17 years ago

#3905 closed (fixed)

app name incorrectly reported in syncdb output

Reported by: kbussell@… 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)

core_management_py.patch (507 bytes ) - added by kbussell@… 17 years ago.
mgmt.diff (813 bytes ) - added by Vinay Sajip <vinay_sajip@…> 17 years ago.
Path now relative to root directory

Download all attachments as: .zip

Change History (8)

by kbussell@…, 17 years ago

Attachment: core_management_py.patch added

comment:1 by Malcolm Tredinnick, 17 years ago

Under what circumstances does this fail? Can you describe a simple example?

in reply to:  1 comment:2 by kbussell@…, 17 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 Vinay Sajip <vinay_sajip@…>, 17 years ago

Owner: changed from Adrian Holovaty to anonymous
Status: newassigned
Triage Stage: UnreviewedAccepted

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 Vinay Sajip <vinay_sajip@…>, 17 years ago

Owner: changed from anonymous to Adrian Holovaty
Status: assignednew

by Vinay Sajip <vinay_sajip@…>, 17 years ago

Attachment: mgmt.diff added

Path now relative to root directory

comment:5 by Vinay Sajip <vinay_sajip@…>, 17 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5131]) Fixed #3905 -- Report app_name correctly in errors during custom SQL
installation. Thanks, kbussell@….

Note: See TracTickets for help on using tickets.
Back to Top