Commit Graph

292 Commits

Author SHA1 Message Date
pyup-bot
b62952d82e Update monotonic from 1.2 to 1.3 2017-07-24 17:54:50 +01:00
pyup-bot
80aeead208 Update marshmallow-sqlalchemy from 0.8.0 to 0.13.1 2017-07-24 17:54:32 +01:00
pyup-bot
c6199cb2ba Update pyjwt from 1.4.2 to 1.5.2 2017-07-24 17:54:24 +01:00
pyup-bot
979a12b682 Update psycopg2 from 2.6.2 to 2.7.3 2017-07-24 17:54:13 +01:00
Chris Hill-Scott
e65619cb90 Bump utils
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/182
2017-07-20 17:32:44 +01:00
Rebecca Law
f77c062d86 Update the notifications-utils version. 2017-07-07 15:22:02 +01:00
Chris Hill-Scott
1747f7c76b Update utils
Depends on:
https://github.com/alphagov/notifications-utils/pull/170

Brings in these changes:
https://github.com/alphagov/notifications-utils/compare/17.1.3...make-the-logo-bigger
or when utils PR is merged
https://github.com/alphagov/notifications-utils/compare/17.1.3...17.4.0
2017-06-22 09:15:28 +01:00
Martyn Inglis
2fe427ac5a Bumped version of celery 2017-06-08 11:04:07 +01:00
Martyn Inglis
7f65aa3eef Merge branch 'master' into remove-nasty-query-from-dashboard
Conflicts:
	app/service/rest.py
	tests/app/service/test_rest.py
2017-06-01 13:11:54 +01:00
Rebecca Law
1f591d3490 Add iso8601 to requirements 2017-05-25 16:13:33 +01:00
Martyn Inglis
390935e82c Bumped utils version 2017-05-24 10:49:34 +01:00
Chris Hill-Scott
e443dc7fed Output contact blocks with placeholders replaced
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/161

Also brings in:
https://github.com/alphagov/notifications-utils/compare/16.1.3...17.0.2
2017-05-11 16:50:36 +01:00
Rebecca Law
42032f871f removed Flask-Redis dependency, it's included in notification-utils. 2017-05-04 14:57:57 +01:00
Martyn Inglis
56a82bb593 Bumped utils version 2017-04-27 09:45:36 +01:00
Martyn Inglis
86a5445fb6 Bumped utils version 2017-04-27 09:26:12 +01:00
Martyn Inglis
2a1c3c248f Bumped utils 2017-04-26 21:21:00 +01:00
Martyn Inglis
2a0f8c8808 Validate International phone numbers
- uses new utils methods to validate phone numbers
- defaults to International=True on validation. This ensures the validator works on all numbers
- Then check if the user can send this message to the number internationally if needed.
2017-04-26 15:56:45 +01:00
Martyn Inglis
d6fc2335e6 Latest utils 2017-04-13 12:52:56 +01:00
Rebecca Law
6949779544 Refactor s3upload
s3upload function has been moved to notifications-utils.
https://github.com/alphagov/notifications-utils/pull/138 must be merge first.

Remove scratch code that I was using to test celery.send_task method

Revert the update to default_retry_delay.
Increase the countdown, wait 1 minute before executing the task.

Some of the changes in my previous commit are included here, that branch will be merged before this one, so it will make sense.

Update version of notification_utils

Update the version of notifications-utils
2017-04-10 17:17:58 +01:00
Rebecca Law
65a91c440b Refactor s3upload
s3upload function has been moved to notifications-utils.
https://github.com/alphagov/notifications-utils/pull/138 must be merge first.
2017-04-10 17:12:56 +01:00
Chris Hill-Scott
7a6d748c6a Build DVLA file with blank TO_NAME_2 field
Problem: we were sending the first line of the address in the
`TO_NAME_2` field. This meant that they couldn’t do any PAF lookups with
it, because it wasn’t where they were expecting.

The first line of the address is the second line of what our users give
us. We need to give this to DVLA as the _third_ line of the address
output, which they call `TO_ADDRESS_LINE_1`.
2017-04-06 13:12:05 +01:00
Chris Hill-Scott
f98f220e74 Update utils to fix letter output
Includes:
- [x] https://github.com/alphagov/notifications-utils/pull/136
- [ ] https://github.com/alphagov/notifications-utils/pull/131
2017-04-05 12:35:28 +01:00
Chris Hill-Scott
1802c84b8a Add handling for data types other than list/string
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/135

Also adds extra tests for:
- the exact issue that we saw in production when #867 was deployed
- what happens when `None` is passed as a placeholder value, because
  this should never get as far as the relevant bit of utils
2017-04-05 09:28:17 +01:00
Chris Hill-Scott
7943b6819b Revert "Revert "Bump utils to allow lists as placeholder values"" 2017-04-05 09:18:58 +01:00
Chris Hill-Scott
cb208473c6 Revert "Bump utils to allow lists as placeholder values" 2017-04-04 15:19:53 +01:00
Chris Hill-Scott
b19486ec99 Include fixes for heading spacing
Brings in
- [x] https://github.com/alphagov/notifications-utils/pull/134
2017-04-03 17:22:34 +01:00
Chris Hill-Scott
585ef8e66a Bump utils to allow lists as placeholder values
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/128

Also adds a test to make sure that passing a dictionary as a value in
the `personalisation` argument works.
2017-03-31 17:02:54 +01:00
Rebecca Law
31979c3272 Use 500 for org id 2017-03-27 17:49:09 +01:00
Rebecca Law
0705cf2f7c Update requirements.txt
pin version of six to resolve deployment issues
2017-03-27 11:12:39 +01:00
Rebecca Law
37a5ce601a Update the version of notifications-utils.
There was a problem with the address block for the DVLATemplate.

Added a countdown to the build_dvla_file.
2017-03-24 15:25:02 +00:00
Imdad Ahad
9ab6d4c68b Update boto3 2017-02-23 17:21:15 +00:00
Leo Hemsted
90dab2a32a bump utils to 13.8.0
brings in character downgrading in SMS previews
2017-02-20 11:56:32 +00:00
Chris Hill-Scott
43173870cb Bump utils to turn off Markdown links 2017-02-17 10:18:52 +00:00
bandesz
72dc93c6db Add awslogs logging for PaaS 2017-02-16 17:38:30 +00:00
Chris Hill-Scott
b2267ae5fc Merge pull request #823 from alphagov/bump-utils-markdown-links
Bump utils to turn on Markdown links
2017-02-13 12:44:19 +00:00
Chris Hill-Scott
6c37686f71 Bump utils to turn on Markdown links 2017-02-08 17:01:44 +00:00
Martyn Inglis
5d0bc0abe8 Add a stop celery script into the scripts folder.
Stopping celery via upstart issues a TERM signal to the whole process group, which immediately kills the worker threads. This can lead to inconsistentcy in the state of a notification as an API call, for example, can take several seconds consequently the likelihood of the call being lost due to a restart is relatively high.

We need to ensure that we stop cleanly to ensure code deploys and autoscale events do not cause issues.

this script is called as part of a pre-stop hook in upstart, which passes a pid file location to the script. The script will then issues the TERM signal to only the master celery process. which will cleanly shut down the workers and exit.

the script will loop based on the existence of a /proc/{pid} for the celery master process. Once the file is gone the script will exit. Upstart blocks on this script before issuing kill on whatever processes may be left hanging around.

the length of the loop is a maximum 15 minutes - which is the tested max time a task may take. In reality it will exit much quicker.
2017-02-08 16:17:50 +00:00
Chris Hill-Scott
6e6d471cda Don’t strip HTML when saving templates
Right now we strip HTML from templates at the point of saving them. This
also converts stuff like ampersands to their entity form (eg &) and
this is what we save in the database.

This is a bad idea when you’re sending a text message or a letter, in
which an HTML entity makes no sense. But we still need to encode HTML in
the body of HTML emails.

The right place to do this is when rendering the templates. The code to
do this is now in utils. So this commit:
- pull in this new utils code
- removes the old
- adds some integration tests to make sure that everything is working
  as expected (more thorough unit tests are happening in utils)
2017-01-19 12:05:28 +00:00
bandesz
fd66fbd719 Run API on Paas 2017-01-13 10:24:13 +00:00
Leo Hemsted
501187a9f4 bump utils to 13.0.1
brings in a fix to InvalidEmail/Phone/AddressExceptions not being
instantiated correctly. `exception.message` is not a python standard,
so we shouldn't be relying on it to transmit exception reasons -
rather we should be using `str(exception)` instead. This involved a
handful of small changes to the schema validation
2017-01-09 16:37:58 +00:00
Leo Hemsted
bf0abce4a3 update python-client version
also unpin the patch version, since it shouldn't matter what patch
we're on provided that the function signatures are the same
2016-12-22 13:53:33 +00:00
Leo Hemsted
5cbe4eb5b2 use cloudfront instead of flask to serve static images
branding in emails was previously hosted from admin app - this changes
the url to be static.{domain}/images instead of {domain}/static/images,
which redirects to cloudfront.

some manipulation of the URL was required to make sure it still serves
locally rather than returning "static.localhost:6012" for example.

(if ADMIN_BASE_URL is localhost it just returns the old /static/
path)

also was able to remove DB interaction from a test. woo!
2016-12-21 16:35:16 +00:00
Chris Hill-Scott
0cc94bc87b Include content count fix
Includes:
- [x] https://github.com/alphagov/notifications-utils/pull/102
2016-12-14 15:51:59 +00:00
Chris Hill-Scott
59af44d7ab Update utils to 12.0.0
Includes:

- [x] https://github.com/alphagov/notifications-utils/pull/94 (breaking
      changes which are responsible for all the changes to the API in
      this PR)

The test for `get_sms_fragment_count` has been removed because this
method is already tested in utils here:

ac20f7e99e/tests/test_base_template.py (L140-L159)
2016-12-13 10:57:01 +00:00
Martyn Inglis
869cf48eff Latest version 2016-12-06 16:51:46 +00:00
Chris Hill-Scott
1e4274655a Bump utils version to really bring in latest changes 2016-12-06 09:45:39 +00:00
Martyn Inglis
3342ca2993 Bumped version 2016-12-02 16:56:23 +00:00
Martyn Inglis
9fb378021c Bumped version to use latest utils
- note this is not yet published so will break.....
- sorts out an issue with service id logging
2016-12-01 17:24:23 +00:00
Martyn Inglis
9667d42008 Minor bump of utils 2016-12-01 12:47:33 +00:00
Martyn Inglis
5ae21bf1d5 Bumped requirements version 2016-12-01 11:34:38 +00:00