#NEWLINE# @ handle_response_format #NEWLINE# @ treeio_login_required #NEWLINE# @ module_admin_required ( ) #NEWLINE# def group_edit( request , group_id , response_format = 'html' ) : #NEWLINE# #INDENT# 'Group edit' #NEWLINE# group = get_object_or_404 ( Group , pk = group_id ) #NEWLINE# if request . POST : #NEWLINE# #INDENT# if ( 'cancel' not in request . POST ) : #NEWLINE# #INDENT# form = GroupForm ( request . POST , instance = group ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# group = form . save ( ) #NEWLINE# return HttpResponseRedirect ( reverse ( 'core_admin_group_view' , args = [ response_format . id ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return HttpResponseRedirect ( reverse ( 'core_admin_group_view' , args = [ group . id ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = GroupForm ( instance = group ) #NEWLINE# #UNINDENT# return render_to_response ( 'core/administration/group_edit' , { #NEWLINE# #INDENT# 'group' : group , #NEWLINE# 'form' : form , #NEWLINE# #UNINDENT# } , context_instance = RequestContext ( request ) , response_format = response_format )