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_usage": "Invalid usage, pass --help to see help",
"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",
"logged_in": "Logged in",
"logged_out": "Logged out",

View file

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