in userbeacon/views.py [0:0]
def create_vs_user(self, user_record, comm):
"""
ask VS to create a user for the given login
:param user_record: User object
:param comm: VSCommunicator instance to perform the request
:return: a Django response to return directly to the client
"""
from .vscommunicator import VSCommunicator, HttpError, HttpTimeoutError
if user_record.is_superuser:
raw_group_list = settings.ADMIN_USER_VSGROUPS
else:
raw_group_list = settings.REGULAR_USER_VSGROUPS
user_group_list = [{"groupName": groupname, "role": False} for groupname in raw_group_list]
request_data = {
"userName": user_record.username,
"realName": self.safe_get_realname(user_record),
"groupList": {
"group": user_group_list,
},
}
comm.do_post("/API/user", request_data)