Custom Query (1173 matches)
Results (187 - 189 of 1173)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#562 | fixed | Don't lower()/upper() locales all the time. | ||
Description |
We will store available (=translated) locales in the form "es_CR". The function get_locale_from_request(request) in tools/translate.py will find the best_match() best on what the webbrowser wants and what we can offer. It will return one of the AVAILABLE_LOCALES items (which we know will be of the form "lc_UP", to there is no need to invoke "locale_to_lower_upper" on every return value. Only invoke that when we parse user input (through the GET/POST parameters to normalize their input). This is probably not costing too much, but it's one more function that is needlessly called for every request we make. |
|||
#564 | fixed | Cookie blocking leads to cryptic errors | ||
Description |
Trying to log in, I received a "403 Forbidden" page with no further information, the GMG log included a "ERROR [mediagoblin.meddleware.csrf] CSRF cookie not present" statement. It took a while until I realized it was my cookie blocker that caused this. Can we capture this specific case somehow and test whether cookie setting is disabled? I know that django tries to set test cookies at some points in time. Perhaps this should be tested in the CSRF meddleware in case of CSRF failure? In any case, we should hand back a nicer error message than 403 forbidden when the user has cookies disabled :-). |
|||
#565 | fixed | Make workbench easier to use | ||
Description |
Currently, you have to get a Workbench from the workbench manager and must not forget to destroy (delete) it yourself after processing. How hard this is? 2 of our current media_type processors (ascii and video) NEVER called workbench.destroy_workbench() which means tons of temporary files and directories were kept around. NONE of our current media_type processors destroy the workbench in case of an exception in the processing function, e.g. on invalid images and stuff. Nice DOS attacks are to be expected, filling up our temp space :-). Finally, we need the same boilerplate for all processing functions, getting a workbench, destroying a workbench, even in the face of exceptions etc. So I propose: 1) to make Workbench() a context manager so that we can do with Workbench() as bench: bench.do_stuff.... which nicely cleans up after itself. 2) A decorator "get_workbench" which will create a Workbench, pass it to the processing function and cleans up when processing finished (even in the face of exceptions). This saves us lots of boilerplate and at least one level of indention. Fortunately, I happen to coincidentally have a branch lying around doing just the above things. |