def get_or_create_root():
 try:
  root = URLPath.root()
  if (not root.article):
   root.delete()
   raise NoRootURL
  return root
 except NoRootURL:
  pass
 starting_content = '\n'.join((_('Welcome to the {platform_name} Wiki').format(platform_name=configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME)), '===', _('Visit a course wiki to add an article.')))
 root = URLPath.create_root(title=_('Wiki'), content=starting_content)
 article = root.article
 article.group = None
 article.group_read = True
 article.group_write = False
 article.other_read = True
 article.other_write = False
 article.save()
 return root

def get_or_create_root ( ) : try : root = URLPath . root ( ) if ( not root . article ) : root . delete ( ) raise NoRootURL return root except NoRootURL : pass starting_content = '\n' . join ( ( _ ( 'Welcome to the {platform_name} Wiki' ) . format ( platform_name = configuration_helpers . get_value ( 'PLATFORM_NAME' , settings . PLATFORM_NAME ) ) , '===' , _ ( 'Visit a course wiki to add an article.' ) ) ) root = URLPath . create_root ( title = _ ( 'Wiki' ) , content = starting_content ) article = root . article article . group = None article . group_read = True article . group_write = False article . other_read = True article . other_write = False article . save ( ) return root
returns the root article .