global name 'OrderTaxDetail' is not defined

19 views
Skip to first unread message

John-Scott

unread,
Jan 6, 2011, 11:46:02 AM1/6/11
to satchm...@googlegroups.com
Perhaps related to my other post [1], I was consistently getting "Exception Value: global name 'OrderTaxDetail' is not defined" when POST-ing to the /store/checkout/ page. Unlike the other error, this was 100% reproducible.

On the production server, I have temporarily edited satchmo_store/shop/models.py to move OrderTaxDetail above the class definition for Order (whose 'force_recalculate_total()' method instantiates an OrderTaxDetail object), changing the FK field to "order = models.ForeignKey('Order', related_name="taxes")" so it lazy looks up the related Order model, now defined below. Voila! No more errors.

Now, I'm not ready to write this off as a Satchmo error since this same version of Satchmo works in my staging and local environments. But I'm at a loss as to what it is about my production environment that causes this to fail (staging is as identical to production as possible).

Any ideas?

[1] https://groups.google.com/d/topic/satchmo-users/p-K21Ks4BbA/discussion
[2] http://dpaste.com/hold/294902/

John-Scott

unread,
Jan 6, 2011, 11:49:04 AM1/6/11
to satchm...@googlegroups.com

John-Scott

unread,
Jan 6, 2011, 11:59:50 AM1/6/11
to satchm...@googlegroups.com
Sorry for the double post. The new Google Groups interface told me there was an error on the first and to try again. Sigh.

John-Scott

unread,
Jan 7, 2011, 12:20:25 PM1/7/11
to satchm...@googlegroups.com
Alright, so this is surprising (to me). In my other post [1] I mentioned random import errors that I was having trouble reproducing on a consistent basis. Chris suggested rolling back to an earlier revision of Satchmo to see if this was a regression. I did not get to that yet, but it looks like I don't need to. After I made the above mentioned change to the shop.models file, all import errors disappeared.

What is especially interesting is that one of the sites has its own virtualenv, while the other 5 share another (the contents are identical and built from the same pip requirements file). I was getting import errors across both virtualenvs but I only modified the shop.models in the virtualenv used by the single site. Now all import errors from all sites have gone away.

At this point I'm going to review my modwsgi configs, but it seems as though there is some strange interaction going on with the two virtualenvs/modwsgi and something particular to Satchmo and its dependencies (did not have any import errors with the 3 non-Satchmo sites). Hopefully I can gain some additional insight into what's going on, so I can either eliminate my temporary patch or come up with a patch that could be justified as belonging in Satchmo.

Cheers,
John-Scott

[1] https://groups.google.com/d/topic/satchmo-users/p-K21Ks4BbA/discussion
Reply all
Reply to author
Forward
0 new messages