mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 14:28:25 -04:00
Add endpoints to serve the agreement
Rather than making users contact us to get the agreement, we should just let them download it, when we know which version to send them. This commit adds two endpoints: - one to serve a page which links to the agreement - one to serve the agreement itself These pages are not linked to anywhere because the underlying files don’t exist yet. So I haven’t bothered putting real content on the page yet either. I imagine the deploy sequence will be: 1. Upload the files to the buckets in each environment 2. Deploy this code through each enviroment, checking the links work 3. Make another PR to start linking to the endpoints added by this commit
This commit is contained in:
26
app/main/views/agreement.py
Normal file
26
app/main/views/agreement.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from flask import render_template, send_file
|
||||
from flask_login import login_required
|
||||
|
||||
from app.main import main
|
||||
from app.main.views.sub_navigation_dictionaries import features_nav
|
||||
from app.main.s3_client import get_mou
|
||||
from app.utils import AgreementInfo
|
||||
|
||||
|
||||
|
||||
@main.route('/agreement')
|
||||
@login_required
|
||||
def agreement():
|
||||
return render_template(
|
||||
'views/agreement.html',
|
||||
crown_status=AgreementInfo.from_current_user().crown_status_or_404,
|
||||
navigation_links=features_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/agreement.pdf')
|
||||
@login_required
|
||||
def download_agreement():
|
||||
return send_file(**get_mou(
|
||||
AgreementInfo.from_current_user().crown_status_or_404
|
||||
))
|
||||
Reference in New Issue
Block a user