mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-01 16:50:07 +08:00
Remove unnecessary exceptions file and more clean up
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
flask.ext.security.exceptions
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Flask-Security exceptions module
|
||||
|
||||
:copyright: (c) 2012 by Matt Wright.
|
||||
:license: MIT, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
|
||||
class SecurityError(Exception):
|
||||
def __init__(self, message=None, user=None):
|
||||
super(SecurityError, self).__init__(message)
|
||||
self.user = user
|
||||
|
||||
|
||||
class BadCredentialsError(SecurityError):
|
||||
"""Raised when an authentication attempt fails due to an error with the
|
||||
provided credentials.
|
||||
"""
|
||||
|
||||
|
||||
class UserNotFoundError(SecurityError):
|
||||
"""Raised by a user datastore when there is an attempt to find a user by
|
||||
their identifier, often username or email, and the user is not found.
|
||||
"""
|
||||
|
||||
|
||||
class RoleNotFoundError(SecurityError):
|
||||
"""Raised by a user datastore when there is an attempt to find a role and
|
||||
the role cannot be found.
|
||||
"""
|
||||
|
||||
|
||||
class ConfirmationError(SecurityError):
|
||||
"""Raised when an confirmation error occurs
|
||||
"""
|
||||
|
||||
|
||||
class ResetPasswordError(SecurityError):
|
||||
"""Raised when a password reset error occurs
|
||||
"""
|
||||
|
||||
|
||||
class PasswordlessLoginError(SecurityError):
|
||||
"""Raised when a passwordless login error occurs
|
||||
"""
|
||||
def __init__(self, message=None, user=None, next=None):
|
||||
super(PasswordlessLoginError, self).__init__(message, user)
|
||||
self.next = next
|
||||
@@ -257,7 +257,6 @@ def create_blueprint(state, import_name):
|
||||
methods=['GET', 'POST'],
|
||||
endpoint='login')(send_login)
|
||||
bp.route(state.login_url + '/<token>',
|
||||
methods=['GET'],
|
||||
endpoint='token_login')(token_login)
|
||||
else:
|
||||
bp.route(state.login_url,
|
||||
|
||||
Reference in New Issue
Block a user