Skip to content

Commit b1d8f5f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b172b9d commit b1d8f5f

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

openlibrary/core/admin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import requests
77
import web
88

9-
from . import db
10-
119
from infogami import config
1210
from openlibrary.core import cache
1311

12+
from . import db
13+
1414

1515
class Stats:
1616
def __init__(self, docs, key, total_key):
@@ -205,7 +205,7 @@ def get_cached_unique_logins_since(since_days=30):
205205
get_unique_logins_since,
206206
key_prefix=key_prefix,
207207
timeout=twelve_hours,
208-
prethread=caching_prethread()
208+
prethread=caching_prethread(),
209209
)
210210
return mc(since_days=since_days)
211211

openlibrary/i18n/messages.pot

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,6 +3478,12 @@ msgstr ""
34783478
msgid "Items"
34793479
msgstr ""
34803480

3481+
#: admin/index.html
3482+
msgid ""
3483+
"<span class=\"login-counts\">0</span> patrons have logged in at least "
3484+
"once over the past 30 days."
3485+
msgstr ""
3486+
34813487
#: admin/index.html
34823488
msgid "Stats"
34833489
msgstr ""
@@ -3614,6 +3620,14 @@ msgstr ""
36143620
msgid "Borrows, last 2 years graph"
36153621
msgstr ""
36163622

3623+
#: admin/index.html
3624+
msgid "Unique Logins"
3625+
msgstr ""
3626+
3627+
#: admin/index.html
3628+
msgid "Gathering login statistics..."
3629+
msgstr ""
3630+
36173631
#: admin/loans_table.html
36183632
msgid "BookReader"
36193633
msgstr ""

openlibrary/plugins/openlibrary/api.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,6 @@ class monthly_logins(delegate.page):
10701070

10711071
def GET(self):
10721072
return delegate.RawText(
1073-
json.dumps({
1074-
"loginCount": get_cached_unique_logins_since()
1075-
}),
1076-
content_type="application/json"
1073+
json.dumps({"loginCount": get_cached_unique_logins_since()}),
1074+
content_type="application/json",
10771075
)

openlibrary/plugins/openlibrary/js/stats/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ export async function initUniqueLoginCounts(containerElem) {
3131
* @see `monthly_logins` class in /openlibrary/plugins/openlibrary/api.py
3232
*/
3333
async function fetchCounts() {
34-
return fetch("/api/monthly_logins.json")
34+
return fetch('/api/monthly_logins.json')
3535
}

0 commit comments

Comments
 (0)