Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8235465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:49:17+00:00 2026-06-07T18:49:17+00:00

Update: The only answer yet given is not helping me. The code works as

  • 0

Update:
The only answer yet given is not helping me. The code works as desired on my local system but does not work in the deployed Python app. This is a series problem for me. Please give this question a serious second look.

Here is some simplified code to show what is happening. When the simplified code is put into the interactive console for the SDK, it always prints out Hello, schott.brian, but in the deployed app its like it prints out no match. What’s up with that?

user = "schott.brian"
name = "schott.brian"

if user and user == name:
     print "Hello, " + user
else:
     print "no match"

Here is my code. Notice the second if checks if user and (user == person.user):

user = users.get_current_user()
ID_id = self.request.get("ID", None)
ID_id = ''.join(ID_id.split())
key = db.Key.from_path("PQ", ID_id)
person = PQ.get(key)
if person: #person's ID DOES exist already
     logging.info("6 person %s" % person.user )
     logging.info("6 key %s" % key )
     logging.info("6 ID_id %s" % ID_id )
     logging.info("6 user %s" % user )
     if user and (user == person.user):
          # never get here on gae, but works on sdk
     else:
          # always gets to here by mistake on gae, but works on SDKs
          logging.info("7 user %s" % user )
          logging.info("7 person %s" % person.user )

Here are the logs for that code on gae and even though user exists and
(user == person.user), that if clause is NOT succeeding. Can you tell me why? Does one of the two really include gmail.com and the other does not?

2012-07-17 15:39:19.993 6 person schott.brian
I 2012-07-17 15:39:19.993 6 key ag1zfnBhcnRpY2lwb2xschMLEgJQUSILY29kZUJTY2hvdHQM
I 2012-07-17 15:39:19.993 6 ID_id codeBSchott
I 2012-07-17 15:39:19.993 6 user schott.brian
I 2012-07-17 15:39:19.993 7 user schott.brian
I 2012-07-17 15:39:19.994 7 person schott.brian
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:49:18+00:00Added an answer on June 7, 2026 at 6:49 pm

    user.get_current_user() returns an object. Printing the user casts it to a string, so maybe you want to do something like:

    if user and (str(user) == str(person.user)):
    

    but you’re actually better off comparing user ids, rather than string representations of user objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question 828421 asked similar question, but received only one real answer (update rubygems) and
I have tried the following MySQL update but it only sets the first field
Update: I can't delete this question, because the answer has been upvoted, yet it
I have posted on this topic before, but as yet I have not had
Another answer shows how to set a default timestamp . However, it updates only
Is there a way to update only the parent UpdatePanel without updating the child
Is there a way to update only Hour part in a DateTime field?? If
I would like to fire an UPDATE trigger only if a certain fields has
The GNU/Linux version of cp has a nice --update flag: -u, --update copy only
Right guys, all autocomplete plugins and functions that I've found, they only update upon

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.