aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking/quick_deployer.py
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2019-05-23 13:30:37 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2019-05-31 15:57:34 -0400
commit63bec7d84cbf1acd3a9a357b58b47584b1701229 (patch)
treecc3f73730dce486752b1380b53d09309a0bfe243 /src/booking/quick_deployer.py
parenta8d84499905504da229d1e8829145bf2d8329dd9 (diff)
Refactor selector step logic
Change-Id: I61e361e63da7453b2eee0e0c162a6f4e48460128 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/booking/quick_deployer.py')
-rw-r--r--src/booking/quick_deployer.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/booking/quick_deployer.py b/src/booking/quick_deployer.py
index 763c8a0..ac69c8c 100644
--- a/src/booking/quick_deployer.py
+++ b/src/booking/quick_deployer.py
@@ -12,7 +12,6 @@ import json
import uuid
import re
from django.db.models import Q
-from django.contrib.auth.models import User
from datetime import timedelta
from django.utils import timezone
from account.models import Lab
@@ -321,12 +320,8 @@ def create_from_form(form, request):
)
booking.pdf = PDFTemplater.makePDF(booking)
- users_field = users_field[2:-2]
- if users_field: # may be empty after split, if no collaborators entered
- users_field = json.loads(users_field)
- for collaborator in users_field:
- user = User.objects.get(id=collaborator['id'])
- booking.collaborators.add(user)
+ for collaborator in users_field: # list of UserProfiles
+ booking.collaborators.add(collaborator.user)
booking.save()