Exemplo n.º 1
0
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'

        if utilities.user_is_logged_in():
            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())

            renderer.render_addanagram(self, utilities.get_logout_url(self),
                                 utilities.get_anagrams_of_user(utilities.get_my_user()))

        else:
            renderer.render_login(self, utilities.get_login_url(self))
Exemplo n.º 2
0
    def get(self):
        self.response.headers['Content-Type'] = 'text/html'

        if utilities.user_is_logged_in():

            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())
            result, wordCount, totalCount = utilities.get_anagrams_of_user(
                utilities.get_my_user())
            renderer.render_main(self, utilities.get_logout_url(self), result,
                                 wordCount, totalCount)

        else:
            renderer.render_login(self, utilities.get_login_url(self))
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'

        if utilities.user_is_logged_in():
            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())

            renderer.render_searchtext(
                self, utilities.get_logout_url(self),
                utilities.generate_id(self.request.get('value')),
                utilities.prepare_text_input(self.request.get('value')),
                utilities.get_anagrams_of_user(utilities.get_my_user()))

        else:
            renderer.render_login(self, utilities.get_login_url(self))
Exemplo n.º 4
0
    def get(self):
        logging.debug("GET")
        self.response.headers['Content-Type'] = 'text/html'

        if utilities.user_is_logged_in():
            # if myuser object is None --> No user with key found --> new user --> make new user in datastore
            if not utilities.user_exists():
                utilities.add_new_user(utilities.get_user())

            renderer.render_subanagram(
                self, utilities.get_logout_url(self), self.request.get('name'),
                utilities.get_anagrams_of_user(utilities.get_my_user()))

        # if no user is logged in create login url
        else:
            renderer.render_login(self, utilities.get_login_url(self))