From 5b70b8f1b8bbbe6aeec43b8d8dfdc6b7cc68bc9c Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Thu, 30 Sep 2021 16:33:01 -0400 Subject: Fixes for collaborator field Signed-off-by: Sawyer Bergeron Change-Id: I3dbdedf26fa84617ea7680a0f99e032d88f1ea98 Signed-off-by: Sawyer Bergeron --- src/api/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/api') diff --git a/src/api/models.py b/src/api/models.py index ec163a1..1f03deb 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -378,17 +378,17 @@ class GeneratedCloudConfig(models.Model): """ user_array = ["default"] users = list(self.booking.collaborators.all()) - users.append(self.booking.owner.userprofile) + users.append(self.booking.owner) for collaborator in users: userdict = {} # TODO: validate if usernames are valid as linux usernames (and provide an override potentially) - userdict['name'] = self._normalize_username(collaborator.user.username) + userdict['name'] = self._normalize_username(collaborator.username) userdict['groups'] = "sudo" userdict['sudo'] = "ALL=(ALL) NOPASSWD:ALL" - userdict['ssh_authorized_keys'] = [self._get_ssh_string(collaborator.user.username)] + userdict['ssh_authorized_keys'] = [self._get_ssh_string(collaborator.username)] user_array.append(userdict) -- cgit 1.2.3-korg