Skip to content

Commit

Permalink
Merge branch 'hotfix/preservation_maintenance_page'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Eardley committed Mar 7, 2023
2 parents 73adf04 + f8a12d6 commit f114fb6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doajtest/testbook/articles_preservation/user_test_script.yml
Expand Up @@ -75,3 +75,11 @@ tests:
- if the status is 'partially success', show details link will be displayed. When
clicked on the link details of how many articles successful and how many not
successful will be displayed
- title: Test maintenance mode for 'Upload preservation file' tab
context:
role: publisher
steps:
- step: Set the value of 'PRESERVATION_PAGE_UNDER_MAINTENANCE' to True in the configuration file (app.cfg/dev.cfg/test.cfg)
- step: Go to preservation area /publisher/preservation
results:
- Maintenance page should be displayed with the content as 'This page is currently offline for maintenance'
5 changes: 5 additions & 0 deletions portality/settings.py
Expand Up @@ -1372,3 +1372,8 @@

# how long should the temporary URL for public data dumps last
PUBLIC_DATA_DUMP_URL_TIMEOUT = 3600

##################################################
# Pages under maintenance

PRESERVATION_PAGE_UNDER_MAINTENANCE = False
9 changes: 9 additions & 0 deletions portality/templates/publisher/readonly.html
@@ -0,0 +1,9 @@
{% extends "publisher/publisher_base.html" %}

{% block page_title %}Down for maintenance{% endblock %}

{% block publisher_content %}
<h2>This page is currently offline for maintenance</h2>
<p>This page is currently unavailable while we carry out some essential maintenance. Please check again later.</p>
</br>
{% endblock %}
3 changes: 3 additions & 0 deletions portality/view/publisher.py
Expand Up @@ -247,6 +247,9 @@ def preservation():
This feature is available for the users who has 'preservation' role.
"""

if app.config.get('PRESERVATION_PAGE_UNDER_MAINTENANCE', False):
return render_template('publisher/readonly.html')

previous = []
try:
previous = models.PreservationState.by_owner(current_user.id)
Expand Down
3 changes: 3 additions & 0 deletions production.cfg
Expand Up @@ -59,3 +59,6 @@ PLAUSIBLE_URL = "https://plausible.io"
# Run notifications through Kafka in production.
#EVENT_SEND_FUNCTION = "portality.events.kafka_producer.send_event"
EVENT_SEND_FUNCTION = "portality.events.shortcircuit.send_event"

# https://github.com/DOAJ/doajPM/issues/3565 2023-03-07
PRESERVATION_PAGE_UNDER_MAINTENANCE = True

0 comments on commit f114fb6

Please sign in to comment.