Skip to content

Commit

Permalink
linting, added CSRF setting to settings_default
Browse files Browse the repository at this point in the history
  • Loading branch information
shayanaijaz committed Nov 9, 2023
1 parent 5c72528 commit bdb2a02
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion server/portal/apps/onboarding/api/views_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def test_admin_route(client, authenticated_staff):
# If the user is authenticated and is_staff, then the route should
# return a JsonResponse
response = client.get("/api/onboarding/admin/")
assert type(response) == JsonResponse
assert isinstance(response, JsonResponse)


def test_admin_route_is_protected(authenticated_user, client):
Expand Down
4 changes: 2 additions & 2 deletions server/portal/apps/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from portal.views.base import BaseApiView
from portal.apps.projects.managers.base import ProjectsManager
from portal.apps.projects.workspace_operations.shared_workspace_operations import \
list_projects, get_project, create_shared_workspace,\
update_project, get_workspace_role, change_user_role, add_user_to_workspace,\
list_projects, get_project, create_shared_workspace, \
update_project, get_workspace_role, change_user_role, add_user_to_workspace, \
remove_user, transfer_ownership
from portal.apps.search.tasks import tapis_project_listing_indexer
from portal.libs.elasticsearch.indexes import IndexedProject
Expand Down
1 change: 0 additions & 1 deletion server/portal/apps/webhooks/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.db import models
from django.conf import settings
from datetime import datetime
from django.utils import timezone


Expand Down
4 changes: 2 additions & 2 deletions server/portal/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

import os
import django
from channels.routing import get_default_application, ProtocolTypeRouter
from channels.routing import ProtocolTypeRouter
from django.core.asgi import get_asgi_application


os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portal.settings.settings')
django.setup()
application = ProtocolTypeRouter({
"http": get_asgi_application(),
})
})
4 changes: 2 additions & 2 deletions server/portal/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
# whether the session cookie should be secure (https:// only)
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SAMESITE = 'Strict'
# for local testing
CSRF_TRUSTED_ORIGINS = ['https://cep.test']
# for local testing
CSRF_TRUSTED_ORIGINS = settings_custom._CSRF_TRUSTED_ORIGINS

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = ['*']
Expand Down
1 change: 1 addition & 0 deletions server/portal/settings/settings_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

_RT_QUEUE = 'Web & Mobile Apps'
_RT_TAG = 'core_portal'
_CSRF_TRUSTED_ORIGINS = ['https://cep.test']

########################
# TAPIS SETTINGS
Expand Down

0 comments on commit bdb2a02

Please sign in to comment.