@handle_response_format
@treeio_login_required
def set_add(request, response_format='html'):
 if request.POST:
  changeset = ChangeSet(author=request.user.profile)
  form = ChangeSetForm(request.user.profile, request.POST, instance=changeset)
  if form.is_valid():
   set = form.save()
   return HttpResponseRedirect(reverse('changes_set_view', args=[set.id]))
 else:
  form = ChangeSetForm(request.user.profile)
 context = _get_default_context(request)
 context.update({'form': form})
 return render_to_response('changes/set_add', context, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def set_add ( request , response_format = 'html' ) : if request . POST : changeset = ChangeSet ( author = request . user . profile ) form = ChangeSetForm ( request . user . profile , request . POST , instance = changeset ) if form . is_valid ( ) : set = form . save ( ) return HttpResponseRedirect ( reverse ( 'changes_set_view' , args = [ set . id ] ) ) else : form = ChangeSetForm ( request . user . profile ) context = _get_default_context ( request ) context . update ( { 'form' : form } ) return render_to_response ( 'changes/set_add' , context , context_instance = RequestContext ( request ) , response_format = response_format )
changeset add .