def authenticate(self, username, password):
        """
        :param username: this is the email or username to check
        """
        # If username is an email address, then try to pull it up
        user = self.get_by_username_or_email(username)

        if not user:
            return None

        if user.check_password(password):
            return user

        return None