Commit Graph

7170 Commits

Author SHA1 Message Date
Leo Hemsted
09a8e863a4 in send flow replace suppress with try catch
suppress was suppressing 404 errors (the happy path) - but it was also
suppressing 503s from tests where we hadn't mocked endpoints
2018-05-03 16:33:32 +01:00
Chris Hill-Scott
c0a5855d2f Improve email address input on sign in
- `type='email'` on the form field
- removing `autocomplete='off'` because it’s a browser feature that
  some people find useful
2018-05-03 16:31:00 +01:00
Leo Hemsted
e8ef6fa174 don't swallow HTTP errors from create_event
tests weren't patching out create_event (which is invoked every time a
user logs in). This was getting caught by our egress proxy on jenkins.
We didn't notice because the event handler code was swallowing all
exceptions and not re-raising.

This changes that code to no longer swallow exceptions. Since we did
that, we also need to update all the tests that test log-in to mock
the call
2018-05-03 16:14:13 +01:00
pyup-bot
d29885f15b Update pyexcel-io from 0.5.6 to 0.5.7 2018-05-02 23:27:01 +01:00
Chris Hill-Scott
23e53a9fae Merge pull request #1992 from alphagov/add-crown-agreement
Let users download the crown agreement
2018-05-02 10:18:37 +01:00
Chris Hill-Scott
793842bb3b Let users download the crown agreement
This (partially) reverts commit dca5546cbd

Depends on

- [ ] agreement being uploaded to the bucket in all environments as
      `crown.pdf`
2018-05-02 09:54:13 +01:00
Chris Hill-Scott
714b9289b4 Merge pull request #2060 from alphagov/pyup-update-pytest-mock-1.9.0-to-1.10.0
Update pytest-mock to 1.10.0
2018-05-02 09:34:38 +01:00
Chris Hill-Scott
2bc1d1f6e5 Merge pull request #2040 from alphagov/gchq
Mark agreement signed by GCHQ
2018-05-02 09:34:26 +01:00
Chris Hill-Scott
b443c299c3 Merge pull request #2058 from alphagov/pyup-update-gunicorn-19.8.0-to-19.8.1
Update gunicorn to 19.8.1
2018-05-02 09:34:15 +01:00
Chris Hill-Scott
a36ecd1f9e Merge pull request #2062 from alphagov/can-show-contents
Fix truncation message for large file
2018-05-02 09:33:30 +01:00
Chris Hill-Scott
403d856fde Fix truncation message for large file
We do show the initial rows now.
2018-05-02 09:24:16 +01:00
Chris Hill-Scott
f7a7ac53e2 Merge pull request #2061 from alphagov/fix-too-many-rows-exception
Bump utils to fix large CSV bug
2018-05-02 09:12:36 +01:00
Chris Hill-Scott
fa3b7603f4 Bump utils to fix large CSV bug
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/473

Changes: https://github.com/alphagov/notifications-utils/compare/27.0.0...fix-too-many-rows-exception
2018-05-01 19:49:45 +01:00
pyup-bot
70420eded5 Update pytest-mock from 1.9.0 to 1.10.0 2018-05-01 18:43:57 +01:00
Alexey Bezhan
c9f40f63ce Merge pull request #2059 from alphagov/upload-document-permission-switch
Add a button for switching 'upload_document' permission
2018-05-01 17:02:11 +01:00
Alexey Bezhan
f663092cf4 Add a button for switching 'upload_document' permission
Adds a platform admin button to the service settings to turn on/off
'upload_document' service permission. The permission allows uploading
documents to document-download-api through the post notification API
endpoint.
2018-05-01 16:53:21 +01:00
Chris Hill-Scott
394ef265ed Merge pull request #2056 from alphagov/no-session-file-uploads
Remove use of session storage from file upload journey
2018-05-01 09:55:05 +01:00
Chris Hill-Scott
054f75a8ed Don’t load the check page if a job exists already
If a user clicks ‘back’ once they’ve sent a job we don’t want them to
land on the ‘check’ page again. This would suggest that they can send
the same job again (they can’t because that `job_id` is in the database
already). That said, it’s confusing to see that page; the natural thing
is to go jump back another step, to where you uploaded the file.
2018-05-01 09:47:05 +01:00
Chris Hill-Scott
b44074bf3a Stop writing job metadata to the session
We’re not looking at the job metadata in the session any more (see
previous commits) so it’s safe to stop writing it.
2018-05-01 09:47:05 +01:00
Chris Hill-Scott
8c04f8f21a Stop checking the session to see if a file’s valid
We’re going to stop storing job metadata in the session. So we can’t
rely on it for checking whether a file is valid. That safeguard is
happening in the API instead now (because it’s looking at the metadata
stored in S3).
2018-05-01 09:47:04 +01:00
Chris Hill-Scott
98214884d3 Stop posting job metadata to the API
The API is looking at the S3 metadata for this information now, so
there’s no need for us to continue sending it through.
2018-05-01 09:47:04 +01:00
Katie Smith
6ea4cf7c07 Merge pull request #1639 from alphagov/delete-senders-reply-addresses
Allow delete email reply to address, SMS senders
2018-05-01 09:07:53 +01:00
Katie Smith
db921896b2 Highlight the new endpoints in the appropriate navigation menus
Added the four new endpoints to navigation.py to determine which (if
any) navigation items get highlighted when the endpoints are visited.
2018-05-01 08:38:54 +01:00
Katie Smith
0e370d511e Update service_api_client to use new endpoints
API now has separate endpoints to archive email reply-to addresses and
SMS senders, so we no longer need to use the endpoints for updating.
2018-05-01 08:38:54 +01:00
Chris Hill-Scott
965bc76c42 Allow delete email reply to address, SMS senders
For both SMS senders and email reply to addresses this commit adds:
- a delete link
- a confirmation loop

It doesn’t let users delete:
- default SMS senders or reply to addresses (they always have to have
  one)
- inbound numbers

It assumes that the API will allow updating of an attribute named
`active` on the respective database rows. It could work in a different
way. We can’t do complete deletion though because these will still be
keyed to notifications.
2018-05-01 08:38:54 +01:00
pyup-bot
f8723bccf0 Update gunicorn from 19.8.0 to 19.8.1 2018-04-30 19:49:55 +01:00
Chris Hill-Scott
63b17001e1 Merge pull request #2041 from alphagov/👑
Add some crown bodies who haven’t signed the MOU
2018-04-30 17:09:04 +01:00
Leo Hemsted
b3101a08b0 Merge pull request #2037 from alphagov/strip-obscure-whitespace
Strip obscure whitespace from form submissions
2018-04-30 14:41:31 +01:00
Leo Hemsted
57bc9469e0 Merge pull request #2052 from alphagov/pyup-update-gunicorn-19.7.1-to-19.8.0
Update gunicorn to 19.8.0
2018-04-30 14:40:13 +01:00
Leo Hemsted
f51042f176 Merge pull request #2051 from alphagov/pyup-update-httpretty-0.8.14-to-0.9.4
Update httpretty to 0.9.4
2018-04-30 14:40:05 +01:00
Leo Hemsted
cae4cd69be Merge pull request #2055 from alphagov/reply-to-anyone
allow non-gov reply to email addresses
2018-04-30 14:39:48 +01:00
Leo Hemsted
60202cf5af allow non-gov reply to email addresses
we reckon users will like to see gov reply-to email addresses because
it will improve their confidence in the email.

however, some services, for a few complex reasons, don't want a gov
reply to address. rather than add their specific domains to the
whitelist for signups etc, just make reply tos allowed from any domain.

We vet reply-tos before services go live anyway.
2018-04-30 14:03:57 +01:00
Chris Hill-Scott
4cd6de15b4 Merge pull request #2038 from alphagov/wigan.gov.uk
Note agreement signed by Wigan Council
2018-04-30 11:56:41 +01:00
Chris Hill-Scott
869e4607f4 Merge pull request #2054 from alphagov/more-metadata
Store original filename as S3 metadata
2018-04-30 11:52:06 +01:00
Chris Hill-Scott
ef4dd9d126 Add some breathing room to file name length limit
Because Amazon stores metadata keys prefixed with `x-amz-` which might
get counted as part of the size.
2018-04-30 11:44:00 +01:00
Chris Hill-Scott
bc8bc727f3 Limit length of filename
S3 has a limit of 2kb for metadata:

> the user-defined metadata is limited to 2 KB in size. The size of
> user-defined metadata is measured by taking the sum of the number of
> bytes in the UTF-8 encoding of each key and value.

– https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#object-metadata

This means we have a limit of 1870 bytes for the filename:
```python
encoded = 'notification_count50000template_id665d26e7-ceac-4cc5-82ed-63d773d21561validTrueoriginal_file_name'.encode('utf-8')
sys.getsizeof(b)
>>> 130
2000-130
>>> 1870
```

Or, in other words, ~918 characters:
```python
sys.getsizeof(('ü'*918).encode('utf-8'))
>>> 1869
```
2018-04-30 11:44:00 +01:00
Chris Hill-Scott
735d5f0a29 Remove redundant call to get_template
We’re getting the template just to get back its `id`, which is the one
thing we do know in order to get it.

The call to get template is still happening inside `_check_messages`, so
we’ll still catch someone trying to look at this page for a template
that doesn’t exist.
2018-04-30 10:06:51 +01:00
Chris Hill-Scott
66e6538d95 Store original filename as S3 metadata
By doing this we no longer have to store it in the session. This is the
last thing that’s currently in the session, so removing it means we can
drop session storage for file uploads entirely.
2018-04-30 10:06:33 +01:00
pyup-bot
fbbc2de13e Update gunicorn from 19.7.1 to 19.8.0 2018-04-28 20:34:52 +01:00
pyup-bot
20deb54d14 Update httpretty from 0.8.14 to 0.9.4 2018-04-28 07:25:52 +01:00
Chris Hill-Scott
2774cf45f2 Merge pull request #2049 from alphagov/removed-endpoint
Remove reference to removed endpoints
2018-04-27 16:54:36 +01:00
Chris Hill-Scott
4cc8f39231 Remove reference to removed endpoints 2018-04-27 16:50:09 +01:00
Chris Hill-Scott
48114f1836 Merge pull request #2047 from alphagov/store-s3-metadata
Store info about files as S3 metadata
2018-04-27 16:43:52 +01:00
Chris Hill-Scott
a42ddc8936 Merge pull request #2045 from alphagov/new-template
Upgrade GOV.UK template to newest version
2018-04-27 16:38:57 +01:00
Chris Hill-Scott
47e3f676a6 Merge pull request #2044 from alphagov/north-to-north-east
Fix which Lincolnshire council signed agreement
2018-04-27 16:38:37 +01:00
Chris Hill-Scott
872d9ea62b Merge pull request #2033 from alphagov/selected-nav
Highlight selected navigation item
2018-04-27 16:38:27 +01:00
Chris Hill-Scott
e7e3b95fee Store info about files as S3 metadata
Storing things in the session is proving buggy – we still have one user
(that we know about) where the session data isn’t getting written, so
they’re blocked from uploading a file.

Since all the info we’re storing in the session is about the file, it
makes sense to store it with the file.

This commit only does the writing of the metadata, once we’re sure this
is working we can do subsequent work to read it back, and remove
reliance on the session.
2018-04-27 16:37:05 +01:00
Leo Hemsted
6e522cb87f Merge pull request #2046 from alphagov/go-live
fix go live link
2018-04-27 16:02:25 +01:00
Leo Hemsted
e8b0e83100 fix go live link 2018-04-27 15:47:47 +01:00
Leo Hemsted
2ceea61bb1 Merge pull request #2034 from alphagov/zendesk
send zendesk rather than deskpro tickets
2018-04-27 14:33:31 +01:00