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:
Chris Hill-Scott
2018-03-16 17:27:47 +00:00
parent d1ae9cc1a6
commit 68292d2299
8 changed files with 191 additions and 1 deletions

View File

@@ -464,6 +464,12 @@ class AgreementInfo:
else:
return 'Cant tell'
@property
def crown_status_or_404(self):
if self.crown_status is None:
abort(404)
return self.crown_status
def as_request_for_agreement(self, with_owner=False):
if with_owner and self.owner:
return (