Merge lp:~stevanr/linaro-license-protection/bug-1085007 into lp:~linaro-automation/linaro-license-protection/trunk
Proposed by
Stevan Radaković
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Данило Шеган | ||||
Approved revision: | 174 | ||||
Merged at revision: | 171 | ||||
Proposed branch: | lp:~stevanr/linaro-license-protection/bug-1085007 | ||||
Merge into: | lp:~linaro-automation/linaro-license-protection/trunk | ||||
Diff against target: |
197 lines (+105/-4) 6 files modified
license_protected_downloads/tests/helpers.py (+43/-0) license_protected_downloads/tests/test_views.py (+29/-1) license_protected_downloads/views.py (+17/-0) settings.py (+6/-0) templates/header.html (+6/-3) urls.py (+4/-0) |
||||
To merge this branch: | bzr merge lp:~stevanr/linaro-license-protection/bug-1085007 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Данило Шеган (community) | Approve | ||
Review via email: mp+150646@code.launchpad.net |
Description of the change
Additional fix for bug 1085007.
When certificates for www.linaro.org are fixed, this code will become obsolete and may be removed.
To post a comment you must log in.
Hi Stevan,
Thanks for working on this. It's very close to being ready to land :)
У уто, 26. 02 2013. у 19:43 +0000, Stevan Radaković пише: protected_ downloads/ views.py'
> === modified file 'license_
> @@ -479,3 +480,13 @@ json.dumps( RenderTextFiles .find_and_ render( path))) static( request) :
> path = result[1]
>
> return HttpResponse(
> +
> +
> +def get_remote_
> +
Please provide a docstring explaining what this does. And replace this blank line with it.
> + name = request. GET.get( "name") SUPPORTED_ REMOTE_ STATIC_ FILES:
> + if name not in settings.
> + raise Http404
Please add a message to this exception: it's always a good practice to
do that.
> + urlopen( settings. SUPPORTED_ REMOTE_ STATIC_ FILES[name] ) REMOTE_ STATIC_ FILES = { www.linaro. org/remote/ js/linarofamily .js", www.linaro. org/remote/ css/init. css", www.linaro. org/remote/ css/remote. css", header. html' header. html 2013-02-21 08:48:00 +0000 header. html 2013-02-26 19:42:24 +0000 "Content- Type" content="text/html; charset= iso-8859- 1"> /www.linaro. org/remote/ css/init. css" rel="stylesheet" type="text/css" > /www.linaro. org/remote/ css/remote. css" rel="stylesheet" type="text/css" > "javascript" type="text/ javascript" src="// www.linaro. org/remote/ js/linarofamily .js"></ script> get-remote- static? name=init. css" rel="stylesheet" type="text/css" > get-remote- static? name=remote. css" rel="stylesheet" type="text/css" > "javascript" type="text/ javascript" src="/get- remote- static? name=linarofami ly.js"> </script>
> + data = urllib2.
> + return HttpResponse(data)
>
> === modified file 'settings.py'
> --- settings.py 2012-11-29 09:36:04 +0000
> +++ settings.py 2013-02-26 19:42:24 +0000
> @@ -191,3 +191,9 @@
> 'Building From Source',
> 'Firmware Update',
> 'RTSM']
> +
> +SUPPORTED_
> + "linarofamily.js": "http://
> + "init.css": "http://
> + "remote.css": "http://
> + }
>
> === modified file 'templates/
> --- templates/
> +++ templates/
> @@ -5,9 +5,9 @@
> {% endif %}
> <meta http-equiv=
> <title>Linaro Snapshots</title>
> - <link href="/
> - <link href="/
> - <script language=
> + <link href="/
> + <link href="/
> + <script language=
This seems to break the line length limit: please fix this by breaking
into multiple lines where needed to meet our 79-character maximum line
length.
> javascript" src="/js/ jquery- 1.7.2.js" ></script> css/(?P< path>.* )$', 'django. views.static. serve', CSS_PATH} ), get-remote- static' , protected_ downloads. views.get_ remote_ static' , remote_ static' ), protected_ downloads. views.show_ license' ,
> <script type="text/
>
> === modified file 'urls.py'
> --- urls.py 2012-10-22 12:48:48 +0000
> +++ urls.py 2013-02-26 19:42:24 +0000
> @@ -22,6 +22,10 @@
> url(r'^
> {'document_root': settings.
>
> + url(r'^
> + 'license_
> + name='get_
> +
> # The license page...
> url(r'^license$',
> 'license_
Btw, any reason there're no tests for this? Seems pretty simple to test
the get_remote_static() view (you might want to override settings in a
test though). It would be good to test the "negative" case as well: the
fact that it throws a 404 wh...