Example #1
0
 def user_create(self, request):
     user = endpoints.get_current_user()
     if not user:
         return API.BooleanMessage(value=False)
     if User.find_User(user.email()):
         return API.BooleanMessage(value=False)
     if len(User.query(User.name==request.value, ancestor=User.parent_key()).fetch()) > 0:
         return API.BooleanMessage(value=False)
     User.create_User(user.email(), request.value)
     return API.BooleanMessage(value=True)
Example #2
0
 def user_get_photo_upload_url(self, request):
     user = endpoints.get_current_user()
     if not user:
         return API.StringMessage()
     USER = User.find_User(user.email())
     if not USER:
         return API.StringMessage()
     url = USER.get_photo_upload_url()
     if url == '/assets/images/default_user_photo.png':
         url = 'http://www.profrate-1148.appspot.com'+url
     return API.StringMessage(value=url)
Example #3
0
 def user_get(self, request):
     user = User.find_User(request.value)
     if not user:
         return UserResponse()
     return UserResponse(user=createUserMessage(user))