Merge lp:~evfool/software-center/lp822625 into lp:software-center

Proposed by Robert Roth
Status: Merged
Merge reported by: Gary Lasker
Merged at revision: not available
Proposed branch: lp:~evfool/software-center/lp822625
Merge into: lp:software-center
Diff against target: 25 lines (+3/-1)
2 files modified
softwarecenter/backend/piston/rnrclient_fake.py (+2/-1)
softwarecenter/backend/reviews/__init__.py (+1/-0)
To merge this branch: bzr merge lp:~evfool/software-center/lp822625
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+107241@code.launchpad.net

Description of the change

Set histogram value in reviewstats to None to avoid AttributeErrors (and add the default histogram value to the fake review api too) as reported in bug #822625.

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Nice, clean fix, thank you as always, Robert!

review: Approve
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Merged into the 5.2 branch, and this will go to trunk on the next merge forward.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/backend/piston/rnrclient_fake.py'
2--- softwarecenter/backend/piston/rnrclient_fake.py 2012-03-16 20:12:57 +0000
3+++ softwarecenter/backend/piston/rnrclient_fake.py 2012-05-24 16:27:52 +0000
4@@ -79,7 +79,8 @@
5 s = {'app_name': '',
6 'package_name': self._PACKAGE_NAMES[i],
7 'ratings_total': str(random.randrange(1, 200)),
8- 'ratings_average': str(random.randrange(0, 5))
9+ 'ratings_average': str(random.randrange(0, 5)),
10+ 'histogram': None
11 }
12 stats.append(s)
13
14
15=== modified file 'softwarecenter/backend/reviews/__init__.py'
16--- softwarecenter/backend/reviews/__init__.py 2012-04-12 14:16:28 +0000
17+++ softwarecenter/backend/reviews/__init__.py 2012-05-24 16:27:52 +0000
18@@ -66,6 +66,7 @@
19 self.ratings_total = 0
20 self.rating_spread = [0, 0, 0, 0, 0]
21 self.dampened_rating = 3.00
22+ self.histogram = None
23
24 def __repr__(self):
25 return ("<ReviewStats '%s' ratings_average='%s' ratings_total='%s'"