Formatting
This commit is contained in:
parent
57c8695bcc
commit
c980567fee
@ -45,6 +45,4 @@ class Command(BaseCommand):
|
||||
.exists()
|
||||
)
|
||||
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(f"{migration} {admin} {whitelabel}")
|
||||
)
|
||||
self.stdout.write(self.style.SUCCESS(f"{migration} {admin} {whitelabel}"))
|
||||
|
@ -304,9 +304,9 @@ class Service(models.Model):
|
||||
|
||||
chart_data = sorted(chart_data.items(), key=lambda k: k[0])
|
||||
chart_data = {
|
||||
'sessions': [v['sessions'] for k, v in chart_data],
|
||||
'hits': [v['hits'] for k, v in chart_data],
|
||||
'labels': [str(k) for k, v in chart_data],
|
||||
"sessions": [v["sessions"] for k, v in chart_data],
|
||||
"hits": [v["hits"] for k, v in chart_data],
|
||||
"labels": [str(k) for k, v in chart_data],
|
||||
}
|
||||
|
||||
return chart_data, chart_tooltip_format, chart_granularity
|
||||
|
@ -26,34 +26,34 @@ class DateRangeMixin:
|
||||
now = timezone.now()
|
||||
return [
|
||||
{
|
||||
'name': 'Last 3 days',
|
||||
'start': now - timezone.timedelta(days=2),
|
||||
'end': now,
|
||||
"name": "Last 3 days",
|
||||
"start": now - timezone.timedelta(days=2),
|
||||
"end": now,
|
||||
},
|
||||
{
|
||||
'name': 'Last 30 days',
|
||||
'start': now - timezone.timedelta(days=29),
|
||||
'end': now,
|
||||
"name": "Last 30 days",
|
||||
"start": now - timezone.timedelta(days=29),
|
||||
"end": now,
|
||||
},
|
||||
{
|
||||
'name': 'Last 90 days',
|
||||
'start': now - timezone.timedelta(days=89),
|
||||
'end': now,
|
||||
"name": "Last 90 days",
|
||||
"start": now - timezone.timedelta(days=89),
|
||||
"end": now,
|
||||
},
|
||||
{
|
||||
'name': 'This month',
|
||||
'start': now.replace(day=1),
|
||||
'end': now,
|
||||
"name": "This month",
|
||||
"start": now.replace(day=1),
|
||||
"end": now,
|
||||
},
|
||||
{
|
||||
'name': 'Last month',
|
||||
'start': now.replace(day=1, month=now.month - 1),
|
||||
'end': now.replace(day=1, month=now.month) - timezone.timedelta(days=1),
|
||||
"name": "Last month",
|
||||
"start": now.replace(day=1, month=now.month - 1),
|
||||
"end": now.replace(day=1, month=now.month) - timezone.timedelta(days=1),
|
||||
},
|
||||
{
|
||||
'name': 'This year',
|
||||
'start': now.replace(day=1, month=1),
|
||||
'end': now,
|
||||
"name": "This year",
|
||||
"start": now.replace(day=1, month=1),
|
||||
"end": now,
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -228,7 +228,7 @@ class ContextualURLNode(template.Node):
|
||||
|
||||
if self.urlnode.asvar:
|
||||
context[self.urlnode.asvar] = url_final
|
||||
return ''
|
||||
return ""
|
||||
else:
|
||||
return url_final
|
||||
|
||||
@ -256,7 +256,7 @@ def percent(value, total):
|
||||
if percent < 0.001:
|
||||
return "<0.1%"
|
||||
|
||||
return f'{percent:.1%}'
|
||||
return f"{percent:.1%}"
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
@ -272,4 +272,4 @@ def bar_width(count, max, total):
|
||||
if percent < 0.001:
|
||||
return "0"
|
||||
|
||||
return f'{percent:.1%}'
|
||||
return f"{percent:.1%}"
|
||||
|
Loading…
Reference in New Issue
Block a user