mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-24 20:33:04 +00:00
fix if statements (#177)
This commit is contained in:
parent
eb5783697b
commit
a7fa867a7c
1 changed files with 3 additions and 3 deletions
|
@ -15,12 +15,12 @@ import stripe
|
|||
def about(request):
|
||||
|
||||
total_views = cache.get('total_views')
|
||||
if total_views:
|
||||
if not total_views:
|
||||
total_views = ResourceView.objects.total_count()
|
||||
cache.set('total_views', total_views)
|
||||
|
||||
average_day = cache.get('average_day')
|
||||
if average_day:
|
||||
if not average_day:
|
||||
average_day = int(round(total_views / ResourceView.objects.count()))
|
||||
cache.set('average_day')
|
||||
|
||||
|
@ -37,7 +37,7 @@ def about(request):
|
|||
def home(request):
|
||||
|
||||
total_views = cache.get('total_views')
|
||||
if total_views:
|
||||
if not total_views:
|
||||
total_views = ResourceView.objects.total_count()
|
||||
total_views = int(round(total_views, -2))
|
||||
cache.set('total_views', total_views)
|
||||
|
|
Loading…
Reference in a new issue