@login_required
@check_local_site_access
def new_review_request(request, local_site=None, template_name=u'reviews/new_review_request.html'):
 valid_repos = []
 repos = Repository.objects.accessible(request.user, local_site=local_site)
 if local_site:
  local_site_name = local_site.name
 else:
  local_site_name = u''
 for repo in repos.order_by(u'name'):
  try:
   scmtool = repo.get_scmtool()
   valid_repos.append({u'id': repo.id, u'name': repo.name, u'scmtool_name': scmtool.name, u'supports_post_commit': repo.supports_post_commit, u'local_site_name': local_site_name, u'files_only': False, u'requires_change_number': scmtool.supports_pending_changesets, u'requires_basedir': (not scmtool.diffs_use_absolute_paths)})
  except Exception:
   logging.exception(u'Error loading SCMTool for repository "%s" (ID %d)', repo.name, repo.id)
 valid_repos.insert(0, {u'id': u'', u'name': _(u'(None - File attachments only)'), u'scmtool_name': u'', u'supports_post_commit': False, u'files_only': True, u'local_site_name': local_site_name})
 return render_to_response(template_name, RequestContext(request, {u'repos': valid_repos}))

@ login_required @ check_local_site_access def new_review_request ( request , local_site = None , template_name = u'reviews/new_review_request.html' ) : valid_repos = [ ] repos = Repository . objects . accessible ( request . user , local_site = local_site ) if local_site : local_site_name = local_site . name else : local_site_name = u'' for repo in repos . order_by ( u'name' ) : try : scmtool = repo . get_scmtool ( ) valid_repos . append ( { u'id' : repo . id , u'name' : repo . name , u'scmtool_name' : scmtool . name , u'supports_post_commit' : repo . supports_post_commit , u'local_site_name' : local_site_name , u'files_only' : False , u'requires_change_number' : scmtool . supports_pending_changesets , u'requires_basedir' : ( not scmtool . diffs_use_absolute_paths ) } ) except Exception : logging . exception ( u'Error loading SCMTool for repository "%s" (ID %d)' , repo . name , repo . id ) valid_repos . insert ( 0 , { u'id' : u'' , u'name' : _ ( u'(None - File attachments only)' ) , u'scmtool_name' : u'' , u'supports_post_commit' : False , u'files_only' : True , u'local_site_name' : local_site_name } ) return render_to_response ( template_name , RequestContext ( request , { u'repos' : valid_repos } ) )
displays the new review request ui .