diff options
author | Filipp Lepalaan <filipp@mac.com> | 2021-05-30 10:34:01 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2021-05-30 10:34:01 +0300 |
commit | 9dcc51f2211385239b0272bdbf2466637c874f35 (patch) | |
tree | 8ac9104abcfa817dc1092e5f338b8c90b4b8aaff /servo/views | |
parent | 467f9fef717cbdc217aae63fef6481150e8e34a7 (diff) | |
download | Servo-9dcc51f2211385239b0272bdbf2466637c874f35.tar.gz Servo-9dcc51f2211385239b0272bdbf2466637c874f35.tar.bz2 Servo-9dcc51f2211385239b0272bdbf2466637c874f35.zip |
Check-in fixes and improvements
Diffstat (limited to 'servo/views')
-rw-r--r-- | servo/views/checkin.py | 13 |
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() |