Exemple #1
0
    def get(self):
        uid = request.args.get('uid', None)
        account = session_util.get_account()

        if account.team and uid:
            rm_account = auth_util.get_account(uid)
            team_util.leave_team(rm_account, account.team)
            flash("Removed {} from your team".format(uid))

        return redirect(url_for('team'))
Exemple #2
0
    def validate(self):
        rv = FlaskForm.validate(self)
        if not rv:
            return False

        account = get_account(self.email.data)

        if account is None:
            self.email.errors.append('This email is not registered.')
            return False

        self.account = account
        return True
Exemple #3
0
    def validate(self):
        if not FlaskForm.validate(self):
            return False

        account = get_account(self.email.data)
        if not account:
            self.email.errors.append('This email is not registered.')
            return False

        if account.team:
            self.email.errors.append('Account is already on a team.')
            return False

        self.account = account
        return True
Exemple #4
0
    def validate(self):
        rv = FlaskForm.validate(self)
        if not rv:
            return False

        account = get_account(self.email.data)

        if account is None:
            self.email.errors.append('This email is not registered.')
            return False

        if not account.check_password(self.password.data):
            self.password.errors.append('Incorrect password.')
            return False

        self.account = account
        return True
Exemple #5
0
 def authorize(self):
     return get_account() is None