1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

advanced search fixes (#984)

* fix advanced search error when not logged in

* fix error with data/my_organizations if user is not logged in

* fix 500 error when viewing advanced search as a user that is not affiliated with any org

* tests for adv search init and anonymous data/my_organizations request

Co-authored-by: Stefan Pratter <stefan@20c.com>
This commit is contained in:
Matt Griswold
2021-05-26 01:33:55 -04:00
committed by GitHub
parent 207ad371c0
commit de413ef1f6
4 changed files with 38 additions and 0 deletions

View File

@@ -195,6 +195,9 @@ def my_organizations(request):
Returns a JSON response with a list of organization names and ids
that the requesting user is a member of
"""
if not request.user.is_authenticated:
return JsonResponse({"my_organizations": []})
return JsonResponse(
{
"my_organizations": [