Skip to content

Commit

Permalink
Merge pull request #1355 from uktrade/develop
Browse files Browse the repository at this point in the history
UAT release
  • Loading branch information
webbyfox authored Jun 2, 2021
2 parents bdc82d7 + e816425 commit e77dcae
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Enhancements
- NOTICKET - update changelog, post-release
### Fixed bugs
- GP2-2890 - DAC NonText Content 01
- GP2-2835 - Disable caching on homepage
- GP2-2889 - DAC Decorative_Images_01 - clear alt tags on decorative images
- GP2-2888 - DAC Dialog_01 - aria-modal on confirmation dialogues.
Expand Down
2 changes: 0 additions & 2 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
]

MIDDLEWARE = [
'wagtailcache.cache.UpdateCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
Expand All @@ -93,7 +92,6 @@
'core.middleware.UserSpecificRedirectMiddleware',
'core.middleware.UserLocationStoreMiddleware',
'core.middleware.StoreUserExpertiseMiddleware',
'wagtailcache.cache.FetchFromCacheMiddleware',
'core.middleware.CheckGATags',
]

Expand Down
6 changes: 0 additions & 6 deletions domestic/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from wagtail.core.models import Page
from wagtail.images import get_image_model_string
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtailcache.cache import WagtailCacheMixin

from core import (
blocks as core_blocks,
Expand Down Expand Up @@ -136,7 +135,6 @@ class DomesticHomePage(
mixins.EnableTourMixin,
mixins.AnonymousUserRequired,
DataLayerMixin,
WagtailCacheMixin,
Page,
):
# Note that this is was the original homepage for Magna/V2 MPV.
Expand All @@ -163,10 +161,6 @@ class DomesticHomePage(
ImageChooserPanel('image'),
]

# Deliberately asking wagtail not to cache homepage
def cache_control(self):
return 'no-cache'


class DomesticDashboard(
mixins.WagtailAdminExclusivePageMixin,
Expand Down
2 changes: 1 addition & 1 deletion exportplan/templates/exportplan/dashboard_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h3 class="m-v-xs bold">Upload your logo</h3>
</a>
</div>
{% else %}
<img alt="{{ request.user.company.name }}" src="{{ request.user.company.logo }}" class="width-full" />
<img alt="Your business logo" src="{{ request.user.company.logo }}" class="width-full" />
<a id="edit-image" href="{% url 'exportplan:add-logo' %}" class="link pencil-link">Edit</a>
{% endif %}
<a class="button button--secondary button--full-width button--icon m-b-xs" href="{% url 'exportplan:pdf-download' %}" title="Save your plan as a PDF">
Expand Down
2 changes: 1 addition & 1 deletion exportplan/templates/exportplan/includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% if not request.user.company.logo %}
<img src="https://via.placeholder.com/200/dfd5c5?text=Company logo" alt="Add a business logo" class="w-1-2">
{% else %}
<img alt="{{ request.user.company.name }}" src="{{ request.user.company.logo }}" class="w-full"/>
<img alt="Your business logo" src="{{ request.user.company.logo }}" class="w-full" />
{% endif %}
</div>
<ul>
Expand Down
27 changes: 0 additions & 27 deletions tests/unit/domestic/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1804,30 +1804,3 @@ def test_allowed_parents(self):
GreatDomesticHomePage,
},
)


@pytest.mark.django_db
def test_great_domestic_homepage_header_cache(root_page, client, user):

homepage = GreatDomesticHomePageFactory(
parent=root_page,
slug='root',
)

SiteFactory(
root_page=homepage,
hostname=client._base_environ()['SERVER_NAME'],
)

for user_logged_in in (False, True):

if user_logged_in:
client.force_login(user)

response = client.get(homepage.url)

assert response.has_header('Cache-Control') is True
assert response.get('Cache-Control') == 'no-cache'

assert response.has_header('X-Wagtail-Cache') is True
assert response.get('X-Wagtail-Cache') == 'skip'

0 comments on commit e77dcae

Please sign in to comment.