Skip to content

Commit

Permalink
Merge pull request #1093 from uktrade/develop
Browse files Browse the repository at this point in the history
UAT / Prod release
  • Loading branch information
Miriam Forner authored Jun 1, 2023
2 parents 5159133 + 9dbd5b6 commit fa7ae71
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 256 deletions.
27 changes: 0 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,39 +67,12 @@ jobs:
pip install flake8
make flake8
migrations:
docker:
- image: circleci/python:3.9.7
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- restore_cache:
key: v1-deps-{{ checksum "requirements_test.txt" }}
- run:
name: Create virtualenv and install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
make install_requirements
- save_cache:
key: v1-deps-{{ checksum "requirements_test.txt" }}
paths:
- "venv"
- run:
name: Check migrations
command: |
. venv/bin/activate
make check_migrations
workflows:
version: 2
test_and_flake8:
jobs:
- test
- flake8
- migrations
- notify:
requires:
- test
2 changes: 1 addition & 1 deletion conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATIC_HOST = env.str('STATIC_HOST', '')
STATIC_URL = STATIC_HOST + '/static/'
STATICFILES_STORAGE = env.str('STATICFILES_STORAGE', 'whitenoise.storage.CompressedManifestStaticFilesStorage')
STATICFILES_STORAGE = env.str('STATICFILES_STORAGE', 'whitenoise.storage.CompressedStaticFilesStorage')
DEFAULT_FILE_STORAGE = env.str('DEFAULT_FILE_STORAGE', 'core.storage_backends.ImmutableFilesS3Boto3Storage')

# Logging for development
Expand Down
83 changes: 29 additions & 54 deletions conf/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import directory_components.views
from directory_components.decorators import skip_ga360
import directory_healthcheck.views
Expand All @@ -8,13 +7,13 @@
from wagtail import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls

from django.conf.urls import include, url
from django.conf.urls import include
from django.conf.urls.static import static
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import RedirectView
from django.urls import path
from django.urls import path, re_path

import core.views
from groups.views import GroupInfoModalView
Expand All @@ -24,104 +23,80 @@


api_urls = [
url(r'^', api_router.urls),
url(
re_path(r'^', api_router.urls),
re_path(
r'^pages/lookup-by-slug/(?P<slug>[\w-]+)/',
api_router.wrap_view(core.views.PageLookupBySlugAPIEndpoint.as_view({'get': 'detail_view'})),
name='lookup-by-slug'
name='lookup-by-slug',
),
url(
re_path(
r'^pages/lookup-by-path/(?P<site_id>[0-9]+)/(?P<path>[\w\-/]*)$',
api_router.wrap_view(core.views.PageLookupByPathAPIEndpoint.as_view({'get': 'detail_view'})),
name='lookup-by-path'
),
url(
r'^pages/types/$',
core.views.PageTypeView.as_view(),
name='pages-types-list'
name='lookup-by-path',
),
re_path(r'^pages/types/$', core.views.PageTypeView.as_view(), name='pages-types-list'),
]


healthcheck_urls = [
url(
r'^$',
directory_healthcheck.views.HealthcheckView.as_view(),
name='healthcheck'
),
url(
r'^ping/$',
directory_healthcheck.views.PingView.as_view(),
name='ping'
),
re_path(r'^$', directory_healthcheck.views.HealthcheckView.as_view(), name='healthcheck'),
re_path(r'^ping/$', directory_healthcheck.views.PingView.as_view(), name='ping'),
]


urlpatterns = [
url(r'^django-admin/', admin.site.urls),
url(
r'^api/',
include((api_urls, 'api'))
),
url(
r'^healthcheck/',
include((healthcheck_urls, 'healthcheck'))
),
url(
re_path(r'^django-admin/', admin.site.urls),
re_path(r'^api/', include((api_urls, 'api'))),
re_path(r'^healthcheck/', include((healthcheck_urls, 'healthcheck'))),
re_path(
r"^robots\.txt$",
skip_ga360(directory_components.views.RobotsView.as_view(template_name='core/robots.txt')),
name='robots'
name='robots',
),
url(
r'^$',
RedirectView.as_view(url='/admin/')
),
url(
re_path(r'^$', RedirectView.as_view(url='/admin/')),
re_path(
r'^admin/pages/(?P<pk>[0-9]+)/copy-upstream/$',
login_required(core.views.CopyUpstreamView.as_view(is_edit=False)),
name='copy-upstream',
),
url(
re_path(
r'^admin/pages/(?P<pk>[0-9]+)/update-upstream/$',
login_required(core.views.UpdateUpstreamView.as_view(is_edit=True)),
name='update-upstream',
),
url(
re_path(
r'^admin/pages/preload/',
login_required(csrf_exempt(core.views.PreloadPageView.as_view())),
name='preload-add-page',
),
url(r'^admin/group-info/$', login_required(GroupInfoModalView.as_view()), name='group-info'),

re_path(r'^admin/group-info/$', login_required(GroupInfoModalView.as_view()), name='group-info'),
# Prevent users from changing their email address
url(r'^admin/account/change_email/$', RedirectView.as_view(url='/admin/')),

url(r'^admin/', include(wagtailadmin_urls)),
url(r'^documents/', include(wagtaildocs_urls)),
url(r'^auth/request-access/', include('users.urls_sso')),

re_path(r'^admin/account/change_email/$', RedirectView.as_view(url='/admin/')),
re_path(r'^admin/', include(wagtailadmin_urls)),
re_path(r'^documents/', include(wagtaildocs_urls)),
re_path(r'^auth/request-access/', include('users.urls_sso')),
# For anything not caught by a more specific rule above, hand over to
# Wagtail's page serving mechanism. This should be the last pattern in
# the list:
url(r'', include(wagtail_urls)),
re_path(r'', include(wagtail_urls)),
path(
'subtitles/<int:great_media_id>/<str:language>/content.vtt',
core.views.serve_subtitles,
name='subtitles-serve',
),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


if settings.FEATURE_FLAGS['ENFORCE_STAFF_SSO_ON']:
urlpatterns = [
url('^auth/', include('authbroker_client.urls')),
url(r'^admin/login/$', RedirectView.as_view(url='/auth/login/', query_string=True)),
re_path('^auth/', include('authbroker_client.urls')),
re_path(r'^admin/login/$', RedirectView.as_view(url='/auth/login/', query_string=True)),
] + urlpatterns


if settings.FEATURE_FLAGS['DEBUG_TOOLBAR_ON']:
import debug_toolbar

urlpatterns = [
url(r'^__debug__/', include(debug_toolbar.urls)),
re_path(r'^__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
Loading

0 comments on commit fa7ae71

Please sign in to comment.