diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-05-31 20:01:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2019-05-31 20:01:57 +0000 |
commit | be541f2ae9e8415a156f3dc7f6796e7c90749181 (patch) | |
tree | 949cb518d8a0fb59244e750992e6752cac751a95 /src/booking/quick_deployer.py | |
parent | 6b8115d7ac8412c9d0ba6899062969b636ed9149 (diff) | |
parent | 63bec7d84cbf1acd3a9a357b58b47584b1701229 (diff) |
Merge "Refactor selector step logic"
Diffstat (limited to 'src/booking/quick_deployer.py')
-rw-r--r-- | src/booking/quick_deployer.py | 9 |
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() |