Commit 3c93c110f77785c8733a585f9791d9ded1213cce
1 parent
12fef7ce
Corrected argument name in frame status manipulation; corrected single element -…
…> list of ints conversion
Showing
1 changed file
with
10 additions
and
4 deletions
semantics/views.py
@@ -769,21 +769,27 @@ def ajax_prepare_cluster(request, unifier_frame_id, system): | @@ -769,21 +769,27 @@ def ajax_prepare_cluster(request, unifier_frame_id, system): | ||
769 | return response | 769 | return response |
770 | 770 | ||
771 | @ajax(method='get', encode_result=True) | 771 | @ajax(method='get', encode_result=True) |
772 | -def ajax_change_frame_statuses_free(request, frame_ids, system): | 772 | +def ajax_change_frame_statuses_free(request, unifier_frame_ids, system): |
773 | # if not request.user.is_authenticated(): | 773 | # if not request.user.is_authenticated(): |
774 | # return {'status': 'not logged in'} | 774 | # return {'status': 'not logged in'} |
775 | if system == 'valUnifier': | 775 | if system == 'valUnifier': |
776 | - status = change_frames_statuses([int(fid) for fid in frame_ids.split(',')], [], system) | 776 | + if type(unifier_frame_ids) is int: |
777 | + status = change_frames_statuses([unifier_frame_ids], [], system) | ||
778 | + else: | ||
779 | + status = change_frames_statuses([int(fid) for fid in unifier_frame_ids.split(',')], [], system) | ||
777 | else: | 780 | else: |
778 | status = 'ok' | 781 | status = 'ok' |
779 | return {'status': status} | 782 | return {'status': status} |
780 | 783 | ||
781 | @ajax(method='get', encode_result=True) | 784 | @ajax(method='get', encode_result=True) |
782 | -def ajax_change_frame_statuses_take(request, frame_ids, system): | 785 | +def ajax_change_frame_statuses_take(request, unifier_frame_ids, system): |
783 | # if not request.user.is_authenticated(): | 786 | # if not request.user.is_authenticated(): |
784 | # return {'status': 'not logged in'} | 787 | # return {'status': 'not logged in'} |
785 | if system == 'valUnifier': | 788 | if system == 'valUnifier': |
786 | - status = change_frames_statuses([], [int(fid) for fid in frame_ids.split(',')], system) | 789 | + if type(unifier_frame_ids) is int: |
790 | + status = change_frames_statuses([], [unifier_frame_ids], system) | ||
791 | + else: | ||
792 | + status = change_frames_statuses([], [int(fid) for fid in unifier_frame_ids.split(',')], system) | ||
787 | else: | 793 | else: |
788 | status = 'ok' | 794 | status = 'ok' |
789 | return {'status': status} | 795 | return {'status': status} |