kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
eaa4e5333a
commit
51fd119c02
|
@ -59,8 +59,10 @@ class ProtocolUserMeta(type(ndb.Model)):
|
|||
|
||||
def reset_protocol_properties():
|
||||
"""Recreates various protocol properties to include choices PROTOCOLS."""
|
||||
Target.protocol = ndb.StringProperty(choices=list(PROTOCOLS.keys()), required=True)
|
||||
Object.source_protocol = ndb.StringProperty(choices=list(PROTOCOLS.keys()))
|
||||
Target.protocol = ndb.StringProperty(
|
||||
'protocol', choices=list(PROTOCOLS.keys()), required=True)
|
||||
Object.source_protocol = ndb.StringProperty(
|
||||
'source_protocol', choices=list(PROTOCOLS.keys()))
|
||||
|
||||
|
||||
def base64_to_long(x):
|
||||
|
|
7
pages.py
7
pages.py
|
@ -286,6 +286,11 @@ def nodeinfo():
|
|||
"""
|
||||
https://nodeinfo.diaspora.software/schema.html
|
||||
"""
|
||||
user_total = None
|
||||
stat = KindStat.query(KindStat.kind_name == 'MagicKey').get()
|
||||
if stat:
|
||||
user_total = stat.count
|
||||
|
||||
return {
|
||||
'version': '2.1',
|
||||
'software': {
|
||||
|
@ -305,7 +310,7 @@ def nodeinfo():
|
|||
},
|
||||
'usage': {
|
||||
'users': {
|
||||
'total': KindStat.query(KindStat.kind_name == 'MagicKey').get().count,
|
||||
'total': user_total,
|
||||
# 'activeMonth':
|
||||
# 'activeHalfyear':
|
||||
},
|
||||
|
|
|
@ -226,3 +226,7 @@ class PagesTest(TestCase):
|
|||
got = self.client.get('/user/user.com/feed?format=rss')
|
||||
self.assert_equals(200, got.status_code)
|
||||
self.assert_equals(self.EXPECTED, contents(rss.to_activities(got.text)))
|
||||
|
||||
def test_nodeinfo(self):
|
||||
# just check that it doesn't crash
|
||||
self.client.get('/nodeinfo.json')
|
||||
|
|
Ładowanie…
Reference in New Issue