From 6ad6f8ce5ce219819705b17632587c065016dfbd Mon Sep 17 00:00:00 2001 From: kakwa Date: Sat, 18 Jul 2015 12:02:00 +0200 Subject: [PATCH] adding exception for user already existing in backend --- ldapcherry/exceptions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ldapcherry/exceptions.py b/ldapcherry/exceptions.py index c249d76..da37cbc 100644 --- a/ldapcherry/exceptions.py +++ b/ldapcherry/exceptions.py @@ -196,6 +196,16 @@ class UserDoesntExist(Exception): " in backend '" + backend + "'" +class UserAlreadyExists(Exception): + def __init__(self, user, backend): + self.user = user + self.bakend = backend + self.log = \ + "user '" + user + "'" \ + " already exists" \ + " in backend '" + backend + "'" + + class GroupDoesntExist(Exception): def __init__(self, group, backend): self.group = group