@csrf_protect
def snippet_edit(request, snippet_name=None, editmode='edit'):
 if (not test_user_authenticated(request)):
  return login(request, next=('/cobbler_web/edit/file:%s' % snippet_name), expired=True)
 if (editmode == 'edit'):
  editable = False
 else:
  editable = True
 deleteable = False
 snippetdata = ''
 if (snippet_name is not None):
  editable = remote.check_access_no_fail(request.session['token'], 'modify_snippet', snippet_name)
  deleteable = True
  snippetdata = remote.read_autoinstall_snippet(snippet_name, request.session['token'])
 t = get_template('snippet_edit.tmpl')
 html = t.render(RequestContext(request, {'snippet_name': snippet_name, 'deleteable': deleteable, 'snippetdata': snippetdata, 'editable': editable, 'editmode': editmode, 'version': remote.extended_version(request.session['token'])['version'], 'username': username}))
 return HttpResponse(html)

@ csrf_protect def snippet_edit ( request , snippet_name = None , editmode = 'edit' ) : if ( not test_user_authenticated ( request ) ) : return login ( request , next = ( '/cobbler_web/edit/file:%s' % snippet_name ) , expired = True ) if ( editmode == 'edit' ) : editable = False else : editable = True deleteable = False snippetdata = '' if ( snippet_name is not None ) : editable = remote . check_access_no_fail ( request . session [ 'token' ] , 'modify_snippet' , snippet_name ) deleteable = True snippetdata = remote . read_autoinstall_snippet ( snippet_name , request . session [ 'token' ] ) t = get_template ( 'snippet_edit.tmpl' ) html = t . render ( RequestContext ( request , { 'snippet_name' : snippet_name , 'deleteable' : deleteable , 'snippetdata' : snippetdata , 'editable' : editable , 'editmode' : editmode , 'version' : remote . extended_version ( request . session [ 'token' ] ) [ 'version' ] , 'username' : username } ) ) return HttpResponse ( html )
this page edits a specific snippet .