All use of render_to_string that don't need `request` shouldn't ask for it

RESOLVED FIXED in 2.1

Status

RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: peterbe, Assigned: peterbe)

Tracking

x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Functions inside views.py files that take `request` as a first positional argument might appear like Django view functions but they're not and should therefore not use RequestContext if they don't actually need it. ``import this``
(Assignee)

Comment 1

7 years ago
Created attachment 590361 [details] [diff] [review]
render_to_string functions refactored
Attachment #590361 - Flags: review?(l10n)

Comment 2

7 years ago
Comment on attachment 590361 [details] [diff] [review]
render_to_string functions refactored

Review of attachment 590361 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, with the removal of the l10nstats snippet call, or that as a follow up bug.

::: apps/homepage/views.py
@@ +111,4 @@
>          return redirect('homepage.views.teams')
>  
>      from l10nstats.views import teamsnippet as stats_snippet
> +    l10nstats_div = mark_safe(stats_snippet(loc))

I think we should really just drop calling in to this at all. The new team page doesn't use this div.

Fine as a follow-up though.
Attachment #590361 - Flags: review?(l10n) → review+
(Assignee)

Comment 3

7 years ago
https://github.com/mozilla/elmo/commit/3ce2de65fcefdf45f67b903e0a05d37ba0ceb2f5
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED

Updated

6 years ago
Assignee: nobody → peterbe
Target Milestone: --- → 2.1
You need to log in before you can comment on or make changes to this bug.