Beispiel #1
0
    def post(self):
        helpers.check_csrf(self.request)

        user = users.get_current_user()
        if not user or not gapps.is_user_authorized(user):
            detail = 'user not authorized' if user else 'user not logged in'
            webapp2.abort(401, detail=detail)

        gapps.authorize_new_user(self.request, user)

        self.response.write('success')
Beispiel #2
0
    def post(self):
        helpers.check_csrf(self.request)

        user = users.get_current_user()
        if not user or not gapps.is_user_authorized(user):
            detail = 'user not authorized' if user else 'user not logged in'
            webapp2.abort(401, detail=detail)

        gapps.authorize_new_user(self.request, user)

        self.response.write('success')
Beispiel #3
0
    def post(self):
        helpers.check_csrf(self.request)

        user = users.get_current_user()
        if not user or not gapps.is_user_authorized(user):
            detail = 'user not authorized' if user else 'user not logged in'
            webapp2.abort(401, detail=detail)

        renew_member = gapps.member_dict_from_request(self.request,
                                                      user.email(), 'renew')
        gapps.renew_member_from_dict(renew_member)

        self.response.write('success')

        # Queue the welcome email
        taskqueue.add(url='/tasks/renew-member-mail', params=renew_member)
Beispiel #4
0
    def post(self):
        helpers.check_csrf(self.request)

        user = users.get_current_user()
        if not user or not gapps.is_user_authorized(user):
            detail = 'user not authorized' if user else 'user not logged in'
            webapp2.abort(401, detail=detail)

        renew_member = gapps.member_dict_from_request(self.request,
                                                      user.email(),
                                                      'renew')
        gapps.renew_member_from_dict(renew_member)

        self.response.write('success')

        # Queue the welcome email
        taskqueue.add(url='/tasks/renew-member-mail', params=renew_member)
Beispiel #5
0
    def post(self):
        """Create the new member.
        '409 Conflict' is thrown if the email address is already associated
        with an existing member.
        """
        helpers.check_csrf(self.request)

        user = users.get_current_user()
        if not user or not gapps.is_user_authorized(user):
            detail = 'user not authorized' if user else 'user not logged in'
            webapp2.abort(401, detail=detail)

        new_member = gapps.member_dict_from_request(self.request, user.email(),
                                                    'join')
        join_or_renew = gapps.join_or_renew_member_from_dict(new_member)

        self.response.write('success: %s' % join_or_renew)

        # Queue the welcome email
        taskqueue.add(url='/tasks/new-member-mail', params=new_member)
Beispiel #6
0
    def post(self):
        """Create the new member.
        '409 Conflict' is thrown if the email address is already associated
        with an existing member.
        """
        helpers.check_csrf(self.request)

        user = users.get_current_user()
        if not user or not gapps.is_user_authorized(user):
            detail = 'user not authorized' if user else 'user not logged in'
            webapp2.abort(401, detail=detail)

        new_member = gapps.member_dict_from_request(self.request,
                                                    user.email(),
                                                    'join')
        join_or_renew = gapps.join_or_renew_member_from_dict(new_member)

        self.response.write('success: %s' % join_or_renew)

        # Queue the welcome email
        taskqueue.add(url='/tasks/new-member-mail', params=new_member)