forked from mirrors/bookwyrm
Merge pull request #909 from mouse-reeve/case-insensitive-webfinger
Case insensitive remote user search
This commit is contained in:
commit
c0c39a5531
3 changed files with 5 additions and 2 deletions
|
@ -112,6 +112,9 @@ class ViewsHelpers(TestCase):
|
||||||
result = views.helpers.handle_remote_webfinger("mouse@local.com")
|
result = views.helpers.handle_remote_webfinger("mouse@local.com")
|
||||||
self.assertEqual(result, self.local_user)
|
self.assertEqual(result, self.local_user)
|
||||||
|
|
||||||
|
result = views.helpers.handle_remote_webfinger("mOuSe@loCal.cOm")
|
||||||
|
self.assertEqual(result, self.local_user)
|
||||||
|
|
||||||
@responses.activate
|
@responses.activate
|
||||||
def test_load_user(self, _):
|
def test_load_user(self, _):
|
||||||
""" find a remote user using webfinger """
|
""" find a remote user using webfinger """
|
||||||
|
|
|
@ -124,7 +124,7 @@ def handle_remote_webfinger(query):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
user = models.User.objects.get(username=query)
|
user = models.User.objects.get(username__iexact=query)
|
||||||
except models.User.DoesNotExist:
|
except models.User.DoesNotExist:
|
||||||
url = "https://%s/.well-known/webfinger?resource=acct:%s" % (domain, query)
|
url = "https://%s/.well-known/webfinger?resource=acct:%s" % (domain, query)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue