Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#21630 closed Cleanup/optimization (fixed)

Simplify find_management_module

Reported by: Aymeric Augustin Owned by: Claude Paroz <claude@…>
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
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

There's a comment that says: "When using manage.py, the project module is added to the path, loaded, then removed from the path."

I believe manage.py no longer does that since 1.4 (new project layout). As a consequence the code could be simplified.

Attachments (1)

21630.diff (2.9 KB ) - added by Claude Paroz 11 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Ramiro Morales, 11 years ago

Thought the same when trying to work on #15084 and reviewing that code.

But, shouldn't that code remain as is to stay compatible with existing project that use old the layout? Or this isn't a supported scenario?

comment:2 by Marc Tamlyn, 11 years ago

I think we've had the new layout long enough - other things which tried to do clever stuff around this have been removed from what I remember. +1 to removing this.

comment:3 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted

by Claude Paroz, 11 years ago

Attachment: 21630.diff added

comment:4 by Claude Paroz, 11 years ago

Has patch: set

Is this too much simplification?

comment:5 by Aymeric Augustin, 10 years ago

Owner: changed from nobody to Aymeric Augustin
Status: newassigned

comment:6 by Aymeric Augustin, 10 years ago

Owner: Aymeric Augustin removed
Status: assignednew
Triage Stage: AcceptedReady for checkin

Yes, your approach seems correct to me. I'd rather remove this stuff and see if someone has an edge case that breaks than leave it without knowing why. The patch will require a small update to apply after 486532. I'll let you push it!

in reply to:  1 comment:7 by Aymeric Augustin, 10 years ago

Replying to ramiro:

But, shouldn't that code remain as is to stay compatible with existing project that use old the layout? Or this isn't a supported scenario?

Because of the app-loading refactor, I don't think it'll be possible to use the old layout with Django 1.7.

comment:8 by Claude Paroz <claude@…>, 10 years ago

Owner: set to Claude Paroz <claude@…>
Resolution: fixed
Status: newclosed

In fe53bc524b9c7cbc814868acde94226d0ba2bc84:

Fixed #21630 -- Simplified management command discovery

Thanks Aymeric Augustin for the report end the review.

comment:9 by Claude Paroz, 10 years ago

I'm not convinced this has to be backported to 1.7. If you think it should, just speak!

comment:10 by Aymeric Augustin, 10 years ago

Yes, I think it should be backported, because if it breaks something, that will be seen as collateral damage of app loading.

comment:11 by Claude Paroz <claude@…>, 10 years ago

In 91ef348bd6ac5d3051d428806b143c419af91aa8:

[1.7.x] Fixed #21630 -- Simplified management command discovery

Thanks Aymeric Augustin for the report end the review.
Backport of fe53bc524 from master.

comment:12 by Aymeric Augustin, 10 years ago

Thank you!

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