0

Sorry, for the weird title but I wanted to elaborate what you would be working with.

So here is what I want to do:

  1. Grab the user_id and hash from my cookie. (Complete)
  2. Put it in a gql query that finds the user_id and hash in my database (In Progress)
  3. Return username if id and hash match from the database (Incomplete)

Everytime I sign up and redirect to the welcome page I get redirected back to the signup page. I've tried countless ways to solve this problem but now I'm asking you guys to help me out!!

Here is the repository to my code: https://github.com/billh93/registration_udacity/blob/master/index.py

Update: I added some code for you guys to see and what I'm hoping to accomplish.

Final Update: I finally solved this I just had to add delete what I had and just insert 2 lines of codes.

Mr.Bill
  • 179
  • 14
  • I see no path through your logic to have a user successfully log in. If they are found in the database, you think they are a duplicate and send them back to the `signup` page. Where is your `login` page? – GAEfan Feb 11 '17 at 21:01
  • Hey @GAEfan thanks for responding. I'm working on the first part of my udacity assingment and they just want us to redirect the user to a welcome page after they sign up. Which is what the code does but it checks the cookie to see if the user id and hash match what it is in the database. If the check fails they get redirected to the sign up page. – Mr.Bill Feb 11 '17 at 21:07
  • If you can run it in your local system you can get what I'm trying to do because looking at code might take you longer to figure it out. – Mr.Bill Feb 11 '17 at 21:08
  • Using queries for user id's isn't a great strategy as you have to deal with eventual consistancy making it harder to check for and enforce eventual consistancy. It would be worth considering using the userid as a key, so you can retrieve entities by key and not have to worry about it as much, (you still have to but don't have to contend with eventual consistancy as well) – Tim Hoffman Feb 12 '17 at 04:51

0 Answers0