@handle_response_format
@treeio_login_required
def task_edit(request, task_id, response_format='html'):
 task = get_object_or_404(Task, pk=task_id)
 if (not request.user.profile.has_permission(task, mode='w')):
  return user_denied(request, message="You don't have access to this Task")
 if request.POST:
  if ('cancel' not in request.POST):
   form = TaskForm(request.user.profile, None, None, None, request.POST, instance=task)
   if form.is_valid():
    task = form.save()
    return HttpResponseRedirect(reverse('projects_task_view', args=[task.id]))
  else:
   return HttpResponseRedirect(reverse('projects_task_view', args=[task.id]))
 else:
  form = TaskForm(request.user.profile, None, None, None, instance=task)
 context = _get_default_context(request)
 context.update({'form': form, 'task': task})
 return render_to_response('projects/task_edit', context, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def task_edit ( request , task_id , response_format = 'html' ) : task = get_object_or_404 ( Task , pk = task_id ) if ( not request . user . profile . has_permission ( task , mode = 'w' ) ) : return user_denied ( request , message = "You don't have access to this Task" ) if request . POST : if ( 'cancel' not in request . POST ) : form = TaskForm ( request . user . profile , None , None , None , request . POST , instance = task ) if form . is_valid ( ) : task = form . save ( ) return HttpResponseRedirect ( reverse ( 'projects_task_view' , args = [ task . id ] ) ) else : return HttpResponseRedirect ( reverse ( 'projects_task_view' , args = [ task . id ] ) ) else : form = TaskForm ( request . user . profile , None , None , None , instance = task ) context = _get_default_context ( request ) context . update ( { 'form' : form , 'task' : task } ) return render_to_response ( 'projects/task_edit' , context , context_instance = RequestContext ( request ) , response_format = response_format )
task edit page .