예제 #1
0
파일: mread.py 프로젝트: tlocke/mread
 def get(self):
     user = users.get_current_user()
     if user is None:
         self.return_ok({})
     else:
         current_reader = self.find_current_reader()
         if current_reader is None:
             fields = {}
             proposed_readers = Reader.gql(
                 "where proposed_email = :1",
                 user.email()).fetch(10)
             if len(proposed_readers) > 0:
                 fields['proposed_readers'] = proposed_readers
             self.return_ok(fields)
         else:
             if 'return_to' in self.request.GET:
                 return_to = self.get_str('return_to')
             else:
                 return_to = "/"
             self.return_found(return_to)
예제 #2
0
파일: mread.py 프로젝트: tlocke/mread
 def find_current_reader(self):
     user = users.get_current_user()
     if user is None:
         return None
     else:
         return Reader.gql("where emails = :1", user.email()).get()