aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views/checkin.py
diff options
context:
space:
mode:
Diffstat (limited to 'servo/views/checkin.py')
-rw-r--r--servo/views/checkin.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/servo/views/checkin.py b/servo/views/checkin.py
index 513625b..fc1719a 100644
--- a/servo/views/checkin.py
+++ b/servo/views/checkin.py
@@ -161,9 +161,12 @@ def init_session(request):
user = get_object_or_404(User, pk=user_id)
request.session['checkin_locations'] = Location.get_checkin_list()
- checkin_users = User.get_checkin_group()
- queryset = checkin_users.filter(location=location)
- request.session['checkin_users'] = User.serialize(queryset)
+ try:
+ checkin_users = User.get_checkin_group()
+ queryset = checkin_users.filter(location=location)
+ request.session['checkin_users'] = User.serialize(queryset)
+ except Exception as e:
+ messages.error(request, _("Failed to launch check-in interface. Please check your system settings."))
request.session['checkin_user'] = user.pk
request.session['checkin_location'] = location.pk
@@ -351,7 +354,7 @@ def index(request):
order.add_device(device, user)
- note = Note(created_by=user, body=idata['issue_description'])
+ note = Note(created_by=user, body=idata['issue_description'], type=Note.T_PROBLEM)
note.is_reported = True
note.order = order
note.save()
@@ -385,7 +388,7 @@ def index(request):
# mark down internal notes (only if logged in)
if len(idata.get('notes')):
- note = Note(created_by=user, body=idata['notes'])
+ note = Note(created_by=user, body=idata['notes'], type=Note.T_NOTE)
note.is_reported = False
note.order = order
note.save()