Commit Graph

11225 Commits

Author SHA1 Message Date
Leo Hemsted
45297eae43 store invited user ids in session
same as the invited org user ids in the previous commit
2021-03-15 12:21:58 +00:00
Leo Hemsted
6d62c9ba36 store invited org user ids in session
first of a two step process to remove invited user objects from the
session. we're removing them because they're of variable size, and with
a lot of folder permissions they can cause the session to exceed the 4kb
cookie size limit and not save properly.

this commit looks at invited org users only.

in this step, start saving the invited org user's id to the
session alongside the session object. Then, if the invited_org_user_id
is present in the next step of the invite flow, fetch the user object
from the API instead of from the session. If it's not present (due to a
session set by an older instance of the admin app), then just use the
old code to get the entire object out of the session.

For invites where the user is small enough to persist to the cookie,
this will still save both the old and the new way, but will always make
an extra check to the API, I think this minor performance hit is totally
fine. For invites where the user is too big to persist, they'll still
fail for now, and will need to wait until the next PR comes along and
stops saving the large invited user object to the session entirely.
2021-03-12 16:36:02 +00:00
Leo Hemsted
c89be0079a rename get_invited_user funcs
make it clear they're expecting a service/org id
2021-03-12 15:59:32 +00:00
Ben Thorner
ee5875668a Merge pull request #3834 from alphagov/update-isort-cf
Update isort config to match that in API
2021-03-12 13:34:16 +00:00
Ben Thorner
1c65d0a13c Update isort config to match that in API
As discussed in [1]. This has no effect on the existing imports.

[1]: https://github.com/alphagov/notifications-api/pull/3175#issuecomment-795530323
2021-03-12 13:03:20 +00:00
Chris Hill-Scott
3d590a71e4 Merge pull request #3831 from alphagov/dont-show-future-financal-year-org-usage
Don’t show future financial years on organisation usage page
2021-03-10 16:49:26 +00:00
Chris Hill-Scott
79bbd0fd98 Don’t show future financal years on org page
There’s no useful information in the page for the future financial year
because there’s no way for any of the services to have yet used
anything.

Changes this matches the change we made to the service usage page in
https://github.com/alphagov/notifications-admin/pull/3439/files
2021-03-10 15:39:06 +00:00
Chris Hill-Scott
19488aad97 Merge pull request #3826 from alphagov/add-new-rates-for-2021-financial-year
Add new free allowance rates for 2021 financial year
2021-03-10 14:41:58 +00:00
David McDonald
12484b08cd Merge pull request #3828 from alphagov/pyup-scheduled-update-2021-03-08
Scheduled weekly dependency update for week 10
2021-03-09 10:25:20 +00:00
David McDonald
3e80ba4734 Fix flake8 and isort errors
Note, isort now has default behaviour of searching recursively so we no
longer need the `-rc` flag
2021-03-08 18:48:56 +00:00
David McDonald
2745fb70d8 make freeze 2021-03-08 18:48:55 +00:00
pyup-bot
f6c382add5 Update xlrd from 1.2.0 to 2.0.1 2021-03-08 18:48:54 +00:00
pyup-bot
58ed109cc9 Update rsa from 4.7.1 to 4.7.2 2021-03-08 18:48:53 +00:00
pyup-bot
2a0bdbc039 Update phonenumbers from 8.12.18 to 8.12.19 2021-03-08 18:48:52 +00:00
pyup-bot
ae9a4d805e Update idna from 2.10 to 3.1 2021-03-08 18:48:51 +00:00
pyup-bot
ec8595a31e Update docutils from 0.15.2 to 0.16 2021-03-08 18:48:50 +00:00
pyup-bot
21b9bfcc83 Update dnspython from 1.16.0 to 2.1.0 2021-03-08 18:48:49 +00:00
pyup-bot
218f48d285 Update colorama from 0.4.3 to 0.4.4 2021-03-08 18:48:48 +00:00
pyup-bot
b3f338813a Update botocore from 1.20.13 to 1.20.22 2021-03-08 18:48:47 +00:00
pyup-bot
69b9627b88 Update boto3 from 1.17.13 to 1.17.22 2021-03-08 18:48:46 +00:00
pyup-bot
fec79380b6 Update awscli from 1.19.13 to 1.19.22 2021-03-08 18:48:45 +00:00
pyup-bot
7cc23020d6 Update requests-mock from 1.7.0 to 1.8.0 2021-03-08 18:48:44 +00:00
pyup-bot
66c0ddc7e2 Update flake8-print from 3.1.4 to 4.0.0 2021-03-08 18:48:43 +00:00
pyup-bot
0e0caa0c33 Update flake8-bugbear from 19.8.0 to 21.3.1 2021-03-08 18:48:42 +00:00
pyup-bot
4dd6668055 Update flake8 from 3.7.9 to 3.8.4 2021-03-08 18:48:41 +00:00
pyup-bot
46df5d7fb9 Update freezegun from 0.3.12 to 1.1.0 2021-03-08 18:48:40 +00:00
pyup-bot
be7ddef86b Update beautifulsoup4 from 4.8.1 to 4.9.3 2021-03-08 18:48:39 +00:00
pyup-bot
a6131ba53a Update pytest-xdist from 1.31.0 to 2.2.1 2021-03-08 18:48:38 +00:00
pyup-bot
908ea66cff Update pytest-mock from 1.11.2 to 3.5.1 2021-03-08 18:48:37 +00:00
pyup-bot
3f0e67aa3a Update pytest from 5.3.2 to 6.2.2 2021-03-08 18:48:36 +00:00
pyup-bot
ce749f536c Update isort from 4.3.21 to 5.7.0 2021-03-08 18:48:35 +00:00
pyup-bot
71f9b12c08 Update eventlet from 0.30.1 to 0.30.2 2021-03-08 18:48:34 +00:00
pyup-bot
cea19e657c Update eventlet from 0.30.1 to 0.30.2 2021-03-08 18:48:33 +00:00
karlchillmaid
5ea3be3e26 Merge pull request #3829 from alphagov/update-pricing-page-march-2021
Update text message pricing content
2021-03-08 17:31:15 +00:00
karlchillmaid
fde5e20ead Remove link 2021-03-08 17:17:59 +00:00
karlchillmaid
6c4fa450e4 change 'local' to 'regional' 2021-03-08 17:17:06 +00:00
Chris Hill-Scott
7013eb9696 Make get_current_financial_year timezone aware
It would have given the wrong answer for the first hour of the 2021
financial year.

This was OK before, because we didn’t need this kind of precision. But
now it could mean someone signing up in the middle of the night getting
the wrong free text message allowance, so we should fix it.
2021-03-08 17:01:04 +00:00
Chris Hill-Scott
61f605ff67 Add new rates for 2021
These are the new rates from
https://docs.google.com/document/d/1aObNQNBw3ayPMl3b_Qc5kZBdaXIAMDnBGtV-xPtFBsc/edit?ts=603f68ea#

We’re changing the free allowance so we can continue to support all the
teams that use Notify. The new allowance means over 90% of teams can
still send all the text messages they need to without paying.
2021-03-08 16:59:29 +00:00
Chris Hill-Scott
9a3f2c30ef Use underscores to notate 1000s
This is easier to read than using multiplication, or nothing.
2021-03-08 16:57:57 +00:00
Chris Hill-Scott
2138ce02d9 Add NHS GP organisation type to test cases
This was missing.
2021-03-08 16:56:16 +00:00
karlchillmaid
2cf7bd46d9 Update link text and add link 2021-03-08 15:54:33 +00:00
karlchillmaid
afa8275e6f Reiterate that the allowance is per year 2021-03-08 15:51:41 +00:00
karlchillmaid
e146e94919 Reiterate that the allowance is per year 2021-03-08 15:48:57 +00:00
karlchillmaid
737b4ea9b8 Update text message pricing content 2021-03-08 15:38:28 +00:00
Katie Smith
7650dd0f47 Merge pull request #3824 from alphagov/invite-user-audit-event
Invite user audit event
2021-03-08 14:43:49 +00:00
Katie Smith
7ae4017d50 Add audit event for inviting users to a service 2021-03-08 14:34:50 +00:00
Chris Hill-Scott
bac54462db Change config structure so allowances are dated
We’re going to have different allowances next financial year. This means
that when someone adds a service, we’ll need to check which year it is,
so we can give them the right allowance.

This commit changes the config structure so that the current allowances
are explicitly assigned to the 2020/21 financial year.

It freezes the tests to the 2020/21 financial year, so they won’t start
failing automatically when next financial year comes around.
2021-03-08 14:25:26 +00:00
David McDonald
fed40326da Fix test assertion
It wasn't varying the email address seen in the header based on the two
parametrized cases. Not the end of the world, but we should make it
correct
2021-03-08 13:40:53 +00:00
Leo Hemsted
76fae6f5f8 Merge pull request #3825 from alphagov/fix
fix syntax
2021-03-05 15:13:35 +00:00
Leo Hemsted
477129644d fix syntax 2021-03-05 15:05:48 +00:00