On Sat, Apr 30, 2011 at 12:20 PM, Karen Tracey <[email protected]>wrote:
> On Fri, Apr 29, 2011 at 12:10 PM, Chris Moffitt <[email protected]>wrote: > >> Karen, >> >> In this specific case, is there a contact that you would expect to be >> associated with the cart? The tricky case about this scenario in general is >> that you must be logged in to the site in order to know if you are an >> "eligible" member. If someone is logged in then it should pull in the >> contact. The default is that if Satchmo can't conclusively determine your >> membership status based on your contact, then you're not a member. >> >> Does that make sense? >> >> > That makes sense, but that isn't what I see happening. Specifically I'm not > seeing "If someone is logged in then it should pull in the contact." in the > the case where there is a user logged in but that user does not already have > a Contact instance set up for them. CartManager from_request is specifically > calling Contact from_request with create=False, so that no Contact is > auto-created for even a logged-in user. Users who already have existing > Contact instances can purchase these members-only products, but users who > don't already have a Contact instance set up for them cannot, even though > they are logged in. > > I'm fine with anonymous users not being able to pass this eligibility test, > but what I don't understand is why logged-in users who would pass the test > aren't able to due to not having a customer set in the cart. Why is > CartManager from_request preventing the auto-creation of a Contact instance > for the user? > > (I'm not overly familiar with Satchmo and its models -- I simply inherited > this site, I did not build it or the code that is attempting to use this > feature. So sorry if my understanding of Satchmo models is off. I get the > impression from a brief look through the code that Contacts are auto-created > for users as needed...but if that is not the case then perhaps my site's > problem is that it is not ensuring Contacts are properly created for users? > If so how would it do that?) > > Ok. Now I understand a bit more. Yes, if there is a Django user created via the admin or another part of the site, then I see how this problem could occur. Typically what I have done in the past is when I create a user through the admin or some other django-registration logic, I would then create the appropriate satchmo contact. Given all this, I can see this is probably not the most intuitive approach & tends to take a satchmo-centric view of the site. You probably have a couple of options: - Modify your site so new registrations get a satchmo contact and write some scripts to create appropriate satchmo contacts for existing users. - Hack the satchmo code to pas along the user as well as the contact so you could check both. I hope this helps. Any suggestions for improvements are always appreciated. Thanks, Chris -- You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
