diff --git a/web/documentserver-example/python/src/utils/users.py b/web/documentserver-example/python/src/utils/users.py index ec080c3e..7083c987 100644 --- a/web/documentserver-example/python/src/utils/users.py +++ b/web/documentserver-example/python/src/utils/users.py @@ -56,10 +56,8 @@ def getUserFromReq(req): return DEFAULT_USER # get users data for mentions -def getUsersForMentions(req): - uid = req.COOKIES.get('uid') +def getUsersForMentions(uid): usersData = [] - for user in USERS: if(user.id != uid and user.name != None and user.email != None): usersData.append({'name':user.name, 'email':user.email}) diff --git a/web/documentserver-example/python/src/views/actions.py b/web/documentserver-example/python/src/views/actions.py index 759e55e0..0a819f3d 100644 --- a/web/documentserver-example/python/src/views/actions.py +++ b/web/documentserver-example/python/src/views/actions.py @@ -222,6 +222,9 @@ def edit(request): 'url': docManager.getServerUrl(True, request) + 'csv' } + # users data for mentions + usersData = users.getUsersForMentions(user.id) if user.id !='uid-0' else None + if jwtManager.isEnabled(): # if the secret key to generate token exists edConfig['token'] = jwtManager.encode(edConfig) # encode the edConfig object into a token dataInsertImage['token'] = jwtManager.encode(dataInsertImage) # encode the dataInsertImage object into a token @@ -239,7 +242,7 @@ def edit(request): 'dataInsertImage': json.dumps(dataInsertImage)[1 : len(json.dumps(dataInsertImage)) - 1], # the image which will be inserted into the document 'dataCompareFile': dataCompareFile, # document which will be compared with the current document 'dataMailMergeRecipients': json.dumps(dataMailMergeRecipients), # recipient data for mail merging - 'users': json.dumps(users.getUsersForMentions(request)) + 'users': json.dumps(usersData) } return render(request, 'editor.html', context) # execute the "editor.html" template with context data