@ensure_csrf_cookie
@login_required
def export_git(request, course_key_string):
 course_key = CourseKey.from_string(course_key_string)
 if (not has_course_author_access(request.user, course_key)):
  raise PermissionDenied()
 course_module = modulestore().get_course(course_key)
 failed = False
 log.debug('export_git course_module=%s', course_module)
 msg = ''
 if (('action' in request.GET) and course_module.giturl):
  if (request.GET['action'] == 'push'):
   try:
    git_export_utils.export_to_git(course_module.id, course_module.giturl, request.user)
    msg = _('Course successfully exported to git repository')
   except git_export_utils.GitExportError as ex:
    failed = True
    msg = unicode(ex)
 return render_to_response('export_git.html', {'context_course': course_module, 'msg': msg, 'failed': failed})

@ ensure_csrf_cookie @ login_required def export_git ( request , course_key_string ) : course_key = CourseKey . from_string ( course_key_string ) if ( not has_course_author_access ( request . user , course_key ) ) : raise PermissionDenied ( ) course_module = modulestore ( ) . get_course ( course_key ) failed = False log . debug ( 'export_git course_module=%s' , course_module ) msg = '' if ( ( 'action' in request . GET ) and course_module . giturl ) : if ( request . GET [ 'action' ] == 'push' ) : try : git_export_utils . export_to_git ( course_module . id , course_module . giturl , request . user ) msg = _ ( 'Course successfully exported to git repository' ) except git_export_utils . GitExportError as ex : failed = True msg = unicode ( ex ) return render_to_response ( 'export_git.html' , { 'context_course' : course_module , 'msg' : msg , 'failed' : failed } )
this method serves up the export to git page .