Using logging.info() I have determined that the appspot is always
return None for "user=users.get_current_user()" and that is why the
app is working differently at appspot that locally. I have tried to
make this a single "transaction" to allow the value of user to be
determined in a timely way, but either I am doing it wrong, or it does
not work. Please advise.
def make_new_map(place_id,self):
user = users.get_current_user()
logging.info("User %s " % user)
if user: #send to add_place.html
logging.info("User if %s " % user)
place= Group(key_name=place_id)
place.place = place_id
place.user = user
place.put()
key = db.Key.from_path("Group", place_id)
path = os.path.join(os.path.dirname(__file__),
'add_place.html')
template_values = dict(place=place.place, user=place.user)
self.response.out.write(template.render(path,
template_values))
else: #send back to choose_place.html
logging.info("User else %s " % user)
path = os.path.join(os.path.dirname(__file__),
'choose_place.html')
template_values = dict()
self.response.out.write(template.render(path,
template_values))
db.run_in_transaction(make_new_map,place_id,self)
Below is a copy of my request log from the appspot; notice the user is
None.
01-07 11:50PM 57.128 /?place=Tester 200 15ms 42ms-cpu 1kb
68.223.88.73 - - [07/Jan/2009:23:50:57 -0800] "GET /?place=Tester HTTP/
1.1" 200 1466 "http://carpoolfinder.appspot.com/" -
I 01-07 11:50PM 57.140
User None
I 01-07 11:50PM 57.140
User else None
Thanks,
Brian in Atlanta
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---