#NEWLINE# def top_contributors_new( request , area ) : #NEWLINE# #INDENT# to_json = JSONRenderer ( ) . render #NEWLINE# if ( area == 'questions' ) : #NEWLINE# #INDENT# api_endpoint = api . TopContributorsQuestions #NEWLINE# locales = sorted ( ( ( settings . LOCALES [ code ] . english , code ) for code in QuestionLocale . objects . locales_list ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( area == 'l10n' ) : #NEWLINE# #INDENT# api_endpoint = api . TopContributorsLocalization #NEWLINE# locales = sorted ( ( ( settings . LOCALES [ code ] . english , code ) for code in settings . SUMO_LANGUAGES ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Http404 #NEWLINE# #UNINDENT# #UNINDENT# if ( ( request . LANGUAGE_CODE != 'en-US' ) and ( request . LANGUAGE_CODE in [ l [ 1 ] for l in locales ] ) ) : #NEWLINE# #INDENT# new_get = { #NEWLINE# #INDENT# 'locale' : request . LANGUAGE_CODE , #NEWLINE# #UNINDENT# } #NEWLINE# new_get . update ( request . GET ) #NEWLINE# request . GET = new_get #NEWLINE# #UNINDENT# contributors = api_endpoint ( ) . get_data ( request ) #NEWLINE# products = ProductSerializer ( Product . objects . filter ( visible = True ) , many = True ) #NEWLINE# return render ( request , 'community/top_contributors_react.html' , { #NEWLINE# #INDENT# 'area' : area , #NEWLINE# 'contributors_json' : to_json ( request ) , #NEWLINE# 'locales_json' : to_json ( locales ) , #NEWLINE# 'products_json' : to_json ( products . data ) , #NEWLINE# #UNINDENT# } )