Skip to content
Snippets Groups Projects
Commit a3d052c2 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Remove 2023 from survey landing and prevent publish of 2024 survey until we...

Remove 2023 from survey landing and prevent publish of 2024 survey until we have sorted new publisher
parent 679cba78
Branches
Tags
No related merge requests found
...@@ -167,7 +167,7 @@ function Landing(): ReactElement { ...@@ -167,7 +167,7 @@ function Landing(): ReactElement {
<div className="wordwrap pt-4" style={{ maxWidth: '75rem' }}> <div className="wordwrap pt-4" style={{ maxWidth: '75rem' }}>
<p style={{ textAlign: "left" }}> <p style={{ textAlign: "left" }}>
Hello, Hello,
<br />Welcome to the GÉANT Compendium Survey. (N)REN Compendium administrators can login via Single Sign On (SSO) <a href="/login">here</a>, which will complete their registration to fill in the 2023 Compendium survey. <br />Welcome to the GÉANT Compendium Survey. (N)REN Compendium administrators can login via Single Sign On (SSO) <a href="/login">here</a>, which will complete their registration to fill in the latest Compendium survey.
This will send a notification to the Compendium administration team and they will assign you to your (N)REN. This will send a notification to the Compendium administration team and they will assign you to your (N)REN.
<br />Once this step has been completed, you will receive an email from the administration team. We aim to get back to you the same working day, but sometimes may take a little longer. <br />Once this step has been completed, you will receive an email from the administration team. We aim to get back to you the same working day, but sometimes may take a little longer.
<br />If you are not sure whether you are a Compendium Administrator for your (N)REN, please contact your GÉANT Partner Relations relationship manager. <br />If you are not sure whether you are a Compendium Administrator for your (N)REN, please contact your GÉANT Partner Relations relationship manager.
......
...@@ -561,7 +561,10 @@ def publish(year): ...@@ -561,7 +561,10 @@ def publish(year):
2023: _map_2023 2023: _map_2023
} }
mapping_function = question_mapping.get(year, _map_2023) # default to 2023 publisher, useful for testing mapping_function = question_mapping.get(year)
if not mapping_function:
raise ValueError(f"No publishing function found for the {year} survey.")
for response in responses: for response in responses:
mapping_function(response.nren, response.answers) mapping_function(response.nren, response.answers)
...@@ -252,7 +252,10 @@ def preview_survey(year) -> Any: ...@@ -252,7 +252,10 @@ def preview_survey(year) -> Any:
if year < 2023: if year < 2023:
return {'message': 'The 2023 survey is the first that can be published from this application'}, 400 return {'message': 'The 2023 survey is the first that can be published from this application'}, 400
publish(year) try:
publish(year)
except ValueError as e:
return {'message': str(e)}, 400
preview = db.session.scalar(select(PreviewYear).where(PreviewYear.year == year)) preview = db.session.scalar(select(PreviewYear).where(PreviewYear.year == year))
if not preview: if not preview:
...@@ -283,7 +286,10 @@ def publish_survey(year) -> Any: ...@@ -283,7 +286,10 @@ def publish_survey(year) -> Any:
if year < 2023: if year < 2023:
return {'message': 'The 2023 survey is the first that can be published from this application'}, 400 return {'message': 'The 2023 survey is the first that can be published from this application'}, 400
publish(year) try:
publish(year)
except ValueError as e:
return {'message': str(e)}, 400
db.session.execute(delete(PreviewYear).where(PreviewYear.year == year)) db.session.execute(delete(PreviewYear).where(PreviewYear.year == year))
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment