mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Handle find friends case if email is invalid.
This commit is contained in:
parent
a46ba555b0
commit
fb061dbb1e
1 changed files with 4 additions and 2 deletions
|
@ -1108,8 +1108,10 @@ def find_friends(request):
|
|||
profiles = []
|
||||
|
||||
if '@' in query:
|
||||
email = re.search(r'[\w\.-]+@[\w\.-]+', query).group(0)
|
||||
profiles = MSocialProfile.objects.filter(email__iexact=email)[:limit]
|
||||
results = re.search(r'[\w\.-]+@[\w\.-]+', query)
|
||||
if results:
|
||||
email = results.group(0)
|
||||
profiles = MSocialProfile.objects.filter(email__iexact=email)[:limit]
|
||||
if not profiles:
|
||||
profiles = MSocialProfile.objects.filter(username__iexact=query)[:limit]
|
||||
if not profiles:
|
||||
|
|
Loading…
Add table
Reference in a new issue