vcard: add flashes on success
This commit is contained in:
parent
0daa5d96a5
commit
b4aff98ddd
1 changed files with 6 additions and 0 deletions
|
@ -247,6 +247,8 @@ class OperationAdd(OperationWithAttrName[AddModifyForm]):
|
|||
|
||||
conn.modify_s(dn, [(ldap.MOD_ADD, self.attr_name, value.encode())])
|
||||
|
||||
flask.flash(f"Added {self.attr_name}", category="info")
|
||||
|
||||
|
||||
class OperationModify(OperationWithUid[AddModifyForm]):
|
||||
kind = "mod"
|
||||
|
@ -274,6 +276,8 @@ class OperationModify(OperationWithUid[AddModifyForm]):
|
|||
conn.modify_s(dn, [(ldap.MOD_DELETE, self.attr_name, self.attr.value)])
|
||||
conn.modify_s(dn, [(ldap.MOD_ADD, self.attr_name, value.encode())])
|
||||
|
||||
flask.flash(f"Modified {self.attr_name}", category="info")
|
||||
|
||||
|
||||
class OperationDelete(OperationWithUid[DelForm]):
|
||||
kind = "del"
|
||||
|
@ -293,6 +297,8 @@ class OperationDelete(OperationWithUid[DelForm]):
|
|||
return
|
||||
conn.modify_s(dn, [(ldap.MOD_DELETE, self.attr_name, self.attr.value)])
|
||||
|
||||
flask.flash(f"Deleted {self.attr_name}", category="info")
|
||||
|
||||
|
||||
@bp.route("/vcard", methods=["GET"])
|
||||
@login_required
|
||||
|
|
Loading…
Add table
Reference in a new issue