Skip to content

Commit

Permalink
fix(infra.py): fix to used datestore. ref #402 @0.25h
Browse files Browse the repository at this point in the history
  • Loading branch information
hayatedayon committed Jul 30, 2018
1 parent 40e116f commit df50ab1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions infra.py
Expand Up @@ -27,7 +27,7 @@


class User(ndb.Model):
user_id = ndb.StringProperty()
id = ndb.StringProperty()
words = ndb.TextProperty()
last_word = ndb.TextProperty()
count = ndb.IntegerProperty()
Expand Down Expand Up @@ -62,8 +62,8 @@ def save_word_datastore(user_id, save_word):
user.count += 1
except Exception:
user = User()
user.user_id = user_id
user.words += save_word
user.id = user_id
user.words = save_word
user.count = 1
user.last_word = save_word
user.put()
Expand Down
2 changes: 1 addition & 1 deletion main.py
Expand Up @@ -47,7 +47,7 @@ def post(self):
queryResult = obj[u'queryResult']
originalDetectIntentRequest = obj['originalDetectIntentRequest']
intentDisplayName = queryResult[u'intent'][u'displayName']
userId = originalDetectIntentRequest[u'user'][u'userId']
userId = originalDetectIntentRequest[u'payload'][u'user'][u'userId']

self.response.headers['Content-Type'] = 'application/json'
if intentDisplayName == GOOGLE_ASSISTANT_WELCOME_INTENT:
Expand Down

0 comments on commit df50ab1

Please sign in to comment.