Merge lp:~canonical-ca-hackers/ubuntu-recommender/fix-is-string-missing-attr into lp:ubuntu-recommender

Proposed by Łukasz Czyżykowski
Status: Merged
Approved by: Łukasz Czyżykowski
Approved revision: 90
Merged at revision: 88
Proposed branch: lp:~canonical-ca-hackers/ubuntu-recommender/fix-is-string-missing-attr
Merge into: lp:ubuntu-recommender
Diff against target: 42 lines (+7/-20)
2 files modified
src/recommender/api/handlers.py (+7/-0)
src/recommender/management/commands/runserver.py (+0/-20)
To merge this branch: bzr merge lp:~canonical-ca-hackers/ubuntu-recommender/fix-is-string-missing-attr
Reviewer Review Type Date Requested Status
Michael Nelson (community) Approve
Review via email: mp+180115@code.launchpad.net

Commit message

Fixes problem with outdated django-piston expecting _is_string attribute on the http response objects.

Description of the change

Fixes problem with outdated django-piston expecting _is_string attribute on the http response objects.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

lukasz: Other than the s/possiblitlit/posibility/ +1

review: Approve
90. By Łukasz Czyżykowski

Typo fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/recommender/api/handlers.py'
2--- src/recommender/api/handlers.py 2013-02-18 19:42:50 +0000
3+++ src/recommender/api/handlers.py 2013-08-14 12:20:34 +0000
4@@ -53,6 +53,13 @@
5 ImplicitFeedbackForm,
6 )
7
8+# django-piston (outdated bit of software) expects those attributes to
9+# determine if the resonse content is iterator or not. Here we never
10+# use that possibility, so hardcoding the attribute.
11+HttpResponse._is_string = True
12+HttpResponseNotFound._is_string = True
13+HttpResponseBadRequest._is_string = True
14+
15
16 def get_top_rated_apps(limit):
17 return [{'package_name': p.name, 'rating': p.wilson_score}
18
19=== removed file 'src/recommender/management/commands/runserver.py'
20--- src/recommender/management/commands/runserver.py 2013-02-22 16:47:48 +0000
21+++ src/recommender/management/commands/runserver.py 1970-01-01 00:00:00 +0000
22@@ -1,20 +0,0 @@
23-# Slightly customized version of Django's runserver command
24-# that runs ubuntu-recommender's wsgi stack.
25-
26-from optparse import make_option
27-from django.core.management.commands.runserver import BaseRunserverCommand
28-from django.core.servers.basehttp import AdminMediaHandler
29-
30-
31-class Command(BaseRunserverCommand):
32- option_list = BaseRunserverCommand.option_list + (
33- make_option(
34- '--adminmedia', dest='admin_media_path', default='',
35- help='Specifies the directory from which to serve admin media.'),
36- )
37-
38- def get_handler(self, *args, **options):
39- """Serves admin media like old-school (deprecation pending)."""
40- from recommender.wsgi import make_app
41- handler = make_app()
42- return AdminMediaHandler(handler, options.get('admin_media_path', ''))

Subscribers

People subscribed via source and target branches