Skip to content

Commit b100167

Browse files
alexwlchanagjohnson
authored andcommitted
Docstring/PEP 257 fixes for the donate app (#2821)
1 parent a3d85df commit b100167

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

readthedocs/donate/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __str__(self):
6666
return self.name
6767

6868
def as_dict(self):
69-
"A dict respresentation of this for JSON encoding"
69+
"""A dict respresentation of this for JSON encoding"""
7070
hash = get_random_string()
7171
domain = getattr(settings, 'PRODUCTION_DOMAIN', 'readthedocs.org')
7272
if self.image:
@@ -191,6 +191,7 @@ def click_ratio(self):
191191

192192

193193
class PromoImpressions(BaseImpression):
194+
194195
"""
195196
Track stats around how successful this promo has been.
196197
@@ -202,6 +203,7 @@ class PromoImpressions(BaseImpression):
202203

203204

204205
class ProjectImpressions(BaseImpression):
206+
205207
"""
206208
Track stats for a specific project and promo.
207209

readthedocs/donate/signals.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def show_to_programming_language(promo, programming_language):
4545
Return True if we haven't set a specific language,
4646
which means show to all languages.
4747
"""
48-
4948
if promo.programming_language:
5049
return programming_language == promo.programming_language
5150
return True
@@ -70,8 +69,8 @@ def choose_promo(promo_list):
7069
(The number of views from this day last week)
7170
Then we can scale the "total ads sold" against that "expected views",
7271
and that will give us more spread throughout the day.
73-
"""
7472
73+
"""
7574
promo_range = []
7675
total_views_needed = 0
7776
for promo in promo_list:
@@ -98,8 +97,8 @@ def get_promo(country_code, programming_language, theme, gold_project=False, gol
9897
* Gold Project status
9998
* Geo
10099
* Programming Language
101-
"""
102100
101+
"""
103102
promo_queryset = SupporterPromo.objects.filter(live=True, display_type='doc')
104103

105104
filtered_promos = []

readthedocs/donate/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def offer_promo(promo_obj, project=None):
2424
This generated a hash as part of the return dict,
2525
so that must be used throughout the processing pipeline in order to dedupe clicks.
2626
"""
27-
2827
promo_dict = promo_obj.as_dict()
2928
promo_obj.incr(OFFERS)
3029
# Set validation cache

0 commit comments

Comments
 (0)