def _document_redirect_to_create(document_slug, document_locale, slug_dict):
 url = reverse('wiki.create', locale=document_locale)
 if (slug_dict['length'] > 1):
  parent_doc = get_object_or_404(Document, locale=document_locale, slug=slug_dict['parent'], is_template=0)
  url = urlparams(url, parent=parent_doc.id, slug=slug_dict['specific'])
 else:
  url = urlparams(url, slug=document_slug)
 return url

def _document_redirect_to_create ( document_slug , document_locale , slug_dict ) : url = reverse ( 'wiki.create' , locale = document_locale ) if ( slug_dict [ 'length' ] > 1 ) : parent_doc = get_object_or_404 ( Document , locale = document_locale , slug = slug_dict [ 'parent' ] , is_template = 0 ) url = urlparams ( url , parent = parent_doc . id , slug = slug_dict [ 'specific' ] ) else : url = urlparams ( url , slug = document_slug ) return url
when a document doesnt exist but the user can create it .