kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
aa5701e158
commit
71cb803840
4
pages.py
4
pages.py
|
@ -74,7 +74,7 @@ def load_user(protocol, id):
|
|||
|
||||
if cls.ABBREV != 'web':
|
||||
if not user:
|
||||
user = cls.query(OR(cls.handle == id, cls.handle == id)).get()
|
||||
user = cls.query(cls.handle == id).get()
|
||||
if user and user.use_instead:
|
||||
user = user.use_instead.get()
|
||||
|
||||
|
@ -84,7 +84,7 @@ def load_user(protocol, id):
|
|||
elif user and id != user.key.id(): # use_instead redirect
|
||||
error('', status=302, location=user.user_page_path())
|
||||
|
||||
if user and (user.direct or cls.ABBREV != 'ap'):
|
||||
if user and (user.direct or user.enabled_protocols or cls.ABBREV == 'web'):
|
||||
assert not user.use_instead
|
||||
return user
|
||||
|
||||
|
|
|
@ -99,8 +99,7 @@ class PagesTest(TestCase):
|
|||
self.assert_equals(404, got.status_code)
|
||||
|
||||
def test_user_not_direct(self):
|
||||
fake = self.make_user('fake:foo', cls=Fake, direct=False)
|
||||
got = self.client.get('/fake/fake:foo')
|
||||
got = self.client.get('/web/user.com')
|
||||
self.assert_equals(200, got.status_code)
|
||||
|
||||
fake = self.make_user('http://fo/o', cls=ActivityPub, direct=False)
|
||||
|
|
Ładowanie…
Reference in New Issue