From 638a785dd8a1d74c0acb8de266d193af4c5aa045 Mon Sep 17 00:00:00 2001 From: Damirkhon Aloev Date: Tue, 6 Dec 2022 14:01:18 +0500 Subject: [PATCH] adding displayEmail field with AES_key encryption --- girderformindlogger/models/user.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/girderformindlogger/models/user.py b/girderformindlogger/models/user.py index 0efa11dbd..a64816d73 100644 --- a/girderformindlogger/models/user.py +++ b/girderformindlogger/models/user.py @@ -38,7 +38,7 @@ def initialize(self): }, language='none') self.exposeFields(level=AccessType.READ, fields=( '_id', 'login', 'public', 'displayName', 'firstName', 'lastName', - 'admin', 'email', 'created')) + 'admin', 'email', 'created', 'displayEmail')) self.exposeFields(level=AccessType.ADMIN, fields=( 'size', 'status', 'emailVerified', 'creatorId')) @@ -55,7 +55,8 @@ def initialize(self): self.initAES([ ('firstName', 64), ('lastName', 64), - ('displayName', 64) + ('displayName', 64), + ('displayEmail', 64) ]) events.bind('model.user.save.created', @@ -508,7 +509,9 @@ def createUser(self, login, password, displayName="", email="", } for gi in list(Group().find(query={"queue": email})) ] if len(email) else [], 'email_encrypted': encryptEmail, - 'accountName': '' + 'accountName': '', + 'displayEmail': email, + } if encryptEmail: if len(email) == 0 or not mail_utils.validateEmailAddress(email): @@ -847,3 +850,4 @@ def get_users_by_ids(self, user_ids): 'timezone', 'deviceId' ] ) +