@require_POST
@login_required
def edit_priority(request, pk):
 source = get_object_or_404(Source, pk=pk)
 if (not can_edit_priority(request.user, source.subproject.project)):
  raise PermissionDenied()
 form = PriorityForm(request.POST)
 if form.is_valid():
  source.priority = form.cleaned_data['priority']
  source.save()
 else:
  messages.error(request, _('Failed to change a priority!'))
 return redirect(request.POST.get('next', source.get_absolute_url()))

@ require_POST @ login_required def edit_priority ( request , pk ) : source = get_object_or_404 ( Source , pk = pk ) if ( not can_edit_priority ( request . user , source . subproject . project ) ) : raise PermissionDenied ( ) form = PriorityForm ( request . POST ) if form . is_valid ( ) : source . priority = form . cleaned_data [ 'priority' ] source . save ( ) else : messages . error ( request , _ ( 'Failed to change a priority!' ) ) return redirect ( request . POST . get ( 'next' , source . get_absolute_url ( ) ) )
change source string priority .