Commit Graph

6133 Commits

Author SHA1 Message Date
Chris Hill-Scott
133db85bc1 Merge pull request #2417 from alphagov/add-count-as-live-flag
Allow excluding services from live services count
2019-03-25 15:45:33 +00:00
Chris Hill-Scott
1f12da3d04 Migrate existing platform admin services to not be counted
If a service has been created by someone on our team, it’s probably a
test service, which shouldn’t be included in the count of live services.

This commit adds a migration to do this for existing services.
2019-03-25 13:30:54 +00:00
Chris Hill-Scott
eb41ce7304 Make service created by platform admin non-counted
If a service has been created by someone on our team, it’s probably a
test service, which shouldn’t be included in the count of live services.
2019-03-25 13:30:13 +00:00
Chris Hill-Scott
b3008ee210 Allow excluding services from live services count
Sometimes we have to make a few services for what really is one
service, for example GOV.UK Pay and GOV.UK Pay Direct Debit. We also
have our own test services which aren’t included in the count of live
services. We currently count these as one service by not including them
in the beta partners spreadsheet.

This adds a column to mark such services as ‘not counted’, which can
later be used to exclude them from reporting.
2019-03-25 13:28:31 +00:00
Chris Hill-Scott
34bcb806ff Merge pull request #2415 from alphagov/fix-branding-association
Fix automatic inheritance of org’s branding
2019-03-22 16:07:21 +00:00
Chris Hill-Scott
6dff916e95 Merge pull request #2407 from alphagov/return-domains-for-org
Return an organisation’s domains and fix a bug where the domains were getting wiped when updating other attributes
2019-03-22 16:07:15 +00:00
Chris Hill-Scott
ef515400f3 Fix automatic inheritance of org’s branding
When creating a service it should inherit it’s organisation’s branding,
if that organisation has branding.

This wasn’t working because we were referring to the ID of the branding
when making the association, not the branding itself.
2019-03-22 15:57:20 +00:00
Katie Smith
9866a38133 Merge pull request #2409 from alphagov/update-dependencies
Update dependencies
2019-03-22 15:00:10 +00:00
Katie Smith
e15884f633 Merge pull request #2413 from alphagov/make-invited-users-folder-permissions-non-nullable
Make invited_users folder_permissions column non-nullable
2019-03-22 15:00:01 +00:00
Leo Hemsted
b4deedd8a9 Merge pull request #2414 from alphagov/unsorted-case
ignore case in the cost_threshold in dvla response files
2019-03-22 14:12:46 +00:00
Leo Hemsted
9da9968028 downgrade error to info 2019-03-22 14:06:45 +00:00
Katie Smith
9b739aaa1c Upgrade flask-marshmallow from 0.9.0 to 0.10.0 2019-03-22 13:43:36 +00:00
Katie Smith
60be63133c Upgrade marshmallow from 2.18.1 to 2.19.1 2019-03-22 13:43:36 +00:00
Katie Smith
5d03b92993 Upgrade marshmallow-sqlalchemy from 0.16.0 to 0.16.1 2019-03-22 13:43:36 +00:00
Katie Smith
05ab6ceeef Upgrade jsonschema from 3.0.0b3 to 3.0.1
Running `make freeze-requirements` causes Werkzeug to be updated from
0.14.1 to 0.15.1, which means that we need to change the message of 1
test.
2019-03-22 13:43:26 +00:00
Leo Hemsted
6fa7f0290d ignore case in the cost_threshold in dvla response files
we failed when we received UNSORTED instead of Unsorted
2019-03-22 12:07:08 +00:00
Katie Smith
8f5b5d636e Make invited_users folder_permissions column non-nullable
Now that notifications-admin is always sending through
folder_permissions, the folder_permissions column of the invited_user
table can be made non-nullable. The migration also backfills the column
(to []) to account for existing null values.
2019-03-22 10:49:45 +00:00
Katie Smith
8eb3e6d4b1 Merge pull request #2398 from alphagov/add-folder-permissions-to-invited-users
Add folder permissions to invited users
2019-03-22 10:48:07 +00:00
Katie Smith
dc5f1035ed Merge pull request #2411 from alphagov/pyup-update-pytest-xdist-1.26.1-to-1.27.0
Update pytest-xdist to 1.27.0
2019-03-22 10:47:35 +00:00
Katie Smith
2aa14bc41c Set folder permissions when adding a user to a service
This sets the folder permissions for a user when adding them to a
service. If a user is being added to a service after accepting an
invite, we need to account for the possibility that the folders we are
trying to add them to have been deleted before they accepted the invite.
2019-03-22 09:30:39 +00:00
Katie Smith
b0d3bd9046 Update add_user_to_service endoint to only handle new data format
Updated the add_user_to_service endpoint to only handle data in the
'new' format (`{"permissions": [...]}` instead of `[permission_1, permission_2]`)
since Admin has been updated to send data the new way.

This change means that we no longer need the Marshmallow Permission
schema, so it can be deleted.
2019-03-22 09:30:39 +00:00
Katie Smith
31ddd36e2c Update invited user tests to take folder_permissions into account 2019-03-22 09:30:39 +00:00
Katie Smith
3e70407981 Migration to add folder_permissions to invited_users table
Added a new JSONB column, folder_permissions, to the invited_users table
to store a list of folders that an invited user can see. This is
nullable for now, but will be changed to be non-nullable and
back-populated later.
2019-03-22 09:30:39 +00:00
Leo Hemsted
ba49b84677 Merge pull request #2412 from alphagov/hash-filename
add a hash of letter filenames to the dvla zip file name
2019-03-21 15:49:59 +00:00
Leo Hemsted
b288031adb add a hash of letter filenames to the dvla zip file name
if we partially retry a day, we would create new zip files, containing
different letters (if some were processed succesfully). We need these
files to have different filenames to earlier zip files so that we can
avoid overwriting log data in zips_sent.

Hashing the filename means that we'll only overwrite if it was the same
file containing the same content.
2019-03-21 15:40:24 +00:00
pyup-bot
365abd9a98 Update pytest-xdist from 1.26.1 to 1.27.0 2019-03-21 13:26:54 +00:00
Leo Hemsted
31d4bfed84 Merge pull request #2405 from alphagov/dvla-filename
pass upload filename to notify-ftp
2019-03-21 11:45:37 +00:00
Chris Hill-Scott
b3976c360a Add test for updating default branding 2019-03-20 14:14:19 +00:00
Chris Hill-Scott
9783ab56b7 Don’t wipe domains when updating other attributes
The domains for an organisation should only be updated (or wiped) if a
new list is explicitly passed in by the admin app.
2019-03-20 12:21:25 +00:00
Leo Hemsted
334eb473ed separate batch num from date
DVLA don't care about the naming conventions of zip files, other than
it must start with `NOTIFY.` and end with `.ZIP`. So lets format the
date in a more readable way, and separate it from the batch number
2019-03-20 12:15:25 +00:00
Chris Hill-Scott
28ea75728c Return domains in get organisation response
We need this so we can disply them in the admin app.
2019-03-20 11:56:17 +00:00
Pea (Malgorzata Tyczynska)
a46e7d62f2 Merge pull request #2404 from alphagov/test-managing-multiple-folder-users-simultaneously
Test update_template_folder can manage multiple users at once
2019-03-19 14:11:41 +00:00
Leo Hemsted
1a4baf4283 pass upload filename to notify-ftp
previously ftp would name the files itself by giving them a timestamp
when uploading. we ran into issues with tasks being picked up multiple
times and as such, uploading duplicate files. By naming the file before
creating the task, we can avoid this issue.

Files are now named `NOTIFY.YYYYMMDD######.ZIP` where the number is a
counter that increments with each task we've issued in that run of
collate-letter-pdfs-for-day
2019-03-19 13:48:17 +00:00
Pea Tyczynska
09731c109e Test update_template_folder can manage multiple users at once 2019-03-19 11:48:37 +00:00
Pea (Malgorzata Tyczynska)
7b8a478b7a Merge pull request #2401 from alphagov/update-folder-viewing-permissions
Update folder viewing permissions when updating a folder
2019-03-19 10:59:58 +00:00
Pea Tyczynska
dabcbc20db Update folder viewing permissions when updating a folder 2019-03-18 17:49:47 +00:00
Chris Hill-Scott
89d5a640b2 Merge pull request #2403 from alphagov/bump-utils-non-plussed-lists
Bump utils
2019-03-18 16:11:31 +00:00
Chris Hill-Scott
f961110603 Bump utils
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/592
2019-03-18 16:01:08 +00:00
Rebecca Law
69e1b47b36 Merge pull request #2402 from alphagov/reduce-zip-file-further
Reduce number of files per zip file
2019-03-18 13:23:34 +00:00
Rebecca Law
be9daf3454 Until we can fix it properly, changing the max number of files to 500. Hopefully the task will finish in less than 5 minutes. 2019-03-18 13:13:05 +00:00
Katie Smith
71c1e2e1be Merge pull request #2395 from alphagov/change-permissions-data-format
Allow add_user_to_service endpoint to accept new data format
2019-03-18 10:03:44 +00:00
Rebecca Law
2a711390da Merge pull request #2399 from alphagov/reduce-zip-file-size
Reduce the number of files sent to the zip-and-send-letter-pdfs task
2019-03-15 16:07:36 +00:00
Rebecca Law
94e0b8b4eb Reduce the number of files sent to the zip-and-send-letter-pdfs
The ftp application is struggling, running out of CPU. This is attempt to help with that.
2019-03-15 15:46:09 +00:00
Katie Smith
d4757c9208 Allow add_user_to_service endpoint to accept new data format
The data posted to the `add_user_to_service` endpoint is currently sent as a
list of permissions:
`[{'permission': MANAGE_SETTINGS}, {'permission': MANAGE_TEMPLATES}]`.

This endpoint is going to also be used for folder permissions, so the
data now needs to be nested:

`{'permissions': [{'permission': MANAGE_SETTINGS}, {'permission': MANAGE_TEMPLATES}]}`

This changes the add_user_to_service endpoint to accept data in either
format. Once admin is sending data in the new format, the code can be
simplified.
2019-03-14 16:59:48 +00:00
Leo Hemsted
6f4b415426 Merge pull request #2397 from alphagov/slow-provider-switch
lower provider switch threshold from 20% to 30%
2019-03-14 16:22:52 +00:00
Leo Hemsted
3a746dd4a2 Merge pull request #2396 from alphagov/service-error-handler
fix constraint name check in service error handler
2019-03-14 16:15:12 +00:00
Leo Hemsted
2f94e1d9bc lower provider switch threshold from 20% to 30%
make it less likely to switch on slow messages to allow more manual
control of provider balance
2019-03-14 16:11:59 +00:00
Leo Hemsted
1efee1fa66 fix constraint name check in service error handler 2019-03-14 12:09:29 +00:00
Alexey Bezhan
2825c3d384 Merge pull request #2394 from alphagov/fix-remove-user-from-service-folder-integrity-error
Change dao_remove_user_from_service query to avoid IntegrityError
2019-03-14 10:54:03 +00:00
Pea (Malgorzata Tyczynska)
aee7dfefb6 Merge pull request #2393 from alphagov/create-folder-with-user-permissions
Set user permissions when creating a folder
2019-03-12 16:36:25 +00:00