action in ldap_operation_error

This commit is contained in:
Kay0u 2020-01-07 23:55:37 +08:00
parent f05cc2c66a
commit 89aef100f0
No known key found for this signature in database
GPG key ID: 7FF262C033518333
2 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@
"invalid_token": "Invalid token - please authenticate", "invalid_token": "Invalid token - please authenticate",
"invalid_usage": "Invalid usage, pass --help to see help", "invalid_usage": "Invalid usage, pass --help to see help",
"ldap_attribute_already_exists": "Attribute '{attribute}' already exists with value '{value}'", "ldap_attribute_already_exists": "Attribute '{attribute}' already exists with value '{value}'",
"ldap_operation_error": "An error occurred during LDAP operation", "ldap_operation_error": "An error occurred during LDAP '{action}' operation",
"ldap_server_down": "Unable to reach LDAP server", "ldap_server_down": "Unable to reach LDAP server",
"logged_in": "Logged in", "logged_in": "Logged in",
"logged_out": "Logged out", "logged_out": "Logged out",

View file

@ -155,7 +155,7 @@ class Authenticator(BaseAuthenticator):
attrs, attrs,
e, e,
) )
raise MoulinetteError("ldap_operation_error") raise MoulinetteError("ldap_operation_error", action="search")
result_list = [] result_list = []
if not attrs or "dn" not in attrs: if not attrs or "dn" not in attrs:
@ -191,7 +191,7 @@ class Authenticator(BaseAuthenticator):
attr_dict, attr_dict,
e, e,
) )
raise MoulinetteError("ldap_operation_error") raise MoulinetteError("ldap_operation_error", action="add")
else: else:
return True return True
@ -215,7 +215,7 @@ class Authenticator(BaseAuthenticator):
rdn, rdn,
e, e,
) )
raise MoulinetteError("ldap_operation_error") raise MoulinetteError("ldap_operation_error", action="remove")
else: else:
return True return True
@ -253,7 +253,7 @@ class Authenticator(BaseAuthenticator):
new_rdn, new_rdn,
e, e,
) )
raise MoulinetteError("ldap_operation_error") raise MoulinetteError("ldap_operation_error", action="update")
else: else:
return True return True