Commit Graph

464 Commits

Author SHA1 Message Date
Martyn Inglis
6c5f9f4cb2 Fix ordering of jobs 2016-03-14 16:50:02 +00:00
Adam Shimali
67484d3f35 Merge pull request #269 from alphagov/invite-registration-sms-only
Change new invite registration flow to only need
2016-03-14 10:55:31 +00:00
Chris Hill-Scott
a4d00cf67e Merge pull request #266 from alphagov/better-placeholder-guidance
Fix bugs and gripes with adding and editing templates
2016-03-14 10:45:00 +00:00
Chris Hill-Scott
144de21745 Make nav and page headings reflect permissions
> If you have the Edit templates permission but not the Send messages permission, the navigation should read
>
> - Text message templates
> - Email templates
> - Letter templates
>
> The page headings should also read
>
> - Text message templates
> - Email templates
> - Letter templates

respectively

https://www.pivotaltracker.com/story/show/115488955
2016-03-14 10:39:53 +00:00
Chris Hill-Scott
370fd68a2c Fix innaccurate headings on add/edit template page
The same `.html` file is shared between adding a template and editing a
template.

The page heading needs to be contextual to the URL, either ‘add’ or ‘edit’.
Somewhere along the way this got lost; this commit reinstates it.
2016-03-14 10:39:52 +00:00
Adam Shimali
164bdad4f2 Change new invite registration flow to only need
sms for verification.

This may change again soon with story to split 2 factor
pages, but for now is correct.
2016-03-14 09:43:34 +00:00
Rebecca Law
6e3bf97af4 Remove services_dao.insert_new_service.
Update api_client.create_service to return the service id.
Fix unit tests.
2016-03-13 09:37:17 +00:00
Rebecca Law
f81dccc513 Merge pull request #263 from alphagov/error-handling
Fix bug in error handlers.
2016-03-11 10:52:53 +00:00
Rebecca Law
f63a85d003 Fix bug in error handlers.
Correct spelling error
2016-03-11 10:16:06 +00:00
Chris Hill-Scott
02dfb2820d Merge pull request #256 from alphagov/name-1-not-test-name
Use ‘name 1’ when sending yourself a message
2016-03-10 19:41:12 +00:00
Rebecca Law
bb82413718 Merge pull request #260 from alphagov/error-handling
Error handling
2016-03-10 16:29:59 +00:00
Rebecca Law
4ba801edab Merge branch 'master' into error-handling
Conflicts:
	app/main/views/invites.py
2016-03-10 15:03:21 +00:00
Adam Shimali
54f871dfba Only actually call api to verify code if both are present in form. 2016-03-10 14:57:29 +00:00
Rebecca Law
735ca07dee Handle HTTPError from API and routing errors from flask.
Removed catching the HTTPError where applicable.
2016-03-10 14:56:47 +00:00
Nicholas Staples
6ea8491b39 Service name uniqueness handled in all cases and tests passing. 2016-03-10 14:29:31 +00:00
Chris Hill-Scott
25103aaef0 Use ‘name 1’ when sending yourself a message
We reckon this is better than ‘test name’, ‘test date’, etc.
2016-03-10 12:03:26 +00:00
Adam Shimali
986edfa317 Check user invite status not accepted before proceeding with flow. 2016-03-10 11:57:40 +00:00
Rebecca Law
f6d98b63ea Refactored register_errorhandlers so that it handles HTTPError
Remove most cases where we catch HTTPError
2016-03-10 11:53:29 +00:00
Adam Shimali
4c323a9a99 Added error message on template for failing to choose permissions.
For error message over ride from WTF forms radio field created
custom field.
2016-03-09 17:42:47 +00:00
Adam Shimali
0095e4b608 Updated from git comments. Return status code 400 for duplicate
email address.
2016-03-09 16:05:17 +00:00
Adam Shimali
33c92a4e29 Fix for duplicate email registration that meant flash error not being
displayed.

The error message does not specify the error is a duplicate email
address so as not to reveal which emails are current user accounts.
2016-03-09 16:05:17 +00:00
Adam Shimali
9523e224bc Removed links for deleting users. Also removed view function
that allowed deletion of users.
2016-03-09 15:30:40 +00:00
Adam Shimali
be5aeb0676 View function for request go live was always calling update service.
Actually this should be no op until whatever workflow will take place
in the real world is implemented.

For the moment just display flash message to say request being
processed and do nothing.
2016-03-09 15:02:05 +00:00
Chris Hill-Scott
8e0a043d31 Merge pull request #247 from alphagov/email-flow-fixes
Email flow fixes
2016-03-09 14:24:41 +00:00
Adam Shimali
208c3cbcf3 Added validation to ensure user can't invite themselves.
Refactored Invited user form into permissions and invite forms
for use in invite and edit permissions.

Added template for edit permissions.
2016-03-09 13:00:52 +00:00
Chris Hill-Scott
91e9cd37b1 Make text of ‘send’ button say ‘email’ or ‘text…’
Previously the send button on the ‘Check and confirm’ page always said
‘Send x messages’, irrespective of whether you were sending emails or text
messages.

This commit makes it say one of
- Send 1 email
- Send 29 emails
- Send 1 text message
- Send 999 text messages
2016-03-09 12:28:22 +00:00
Chris Hill-Scott
b93a1e89c8 Fix bug which prevented viewing an email job
The template for viewing a job was not getting all the variables it needed in
order to display an email template. Hadn’t noticed this before, because email
templates require more variables than SMS templates.

This commit fixes that bug.
2016-03-09 12:25:33 +00:00
Adam Shimali
acc7c6cda3 Display email address that invitee will be registered with.
Also add flash message for users who already have an account.
2016-03-09 11:27:26 +00:00
Chris Hill-Scott
131d1bedba Merge pull request #241 from alphagov/utils-csv-processing
Give the user better error messages for CSV files
2016-03-09 11:19:20 +00:00
Chris Hill-Scott
c1bf48f91e Don’t catch exceptions if API fails to create job
There is no good reason why the API should fail to create a job at this point.
If it’s returning a 404, this is an error, and we should be monitoring for it.
So we should let it raise, and throw a 500.
2016-03-08 18:36:23 +00:00
Chris Hill-Scott
eb3734f1d1 Give the user better error messages for CSV files
Makes uses of the additions to utils in https://github.com/alphagov/notifications-utils/pull/9

This commit strips out a lot of the complex stuff that the views and templates
in this app were doing. There is now a cleaner separation of concerns:

- utils returns the number and type of errors in the csv
- `get_errors_for_csv` helper in this app maps the number and type of errors
  onto human-friendly error messages
- the view and template just doing the glueing-together of all the pieces

This is (hopefully) easier to understand, definitely makes the component
parts easier to test in isolation, and makes it easier to give more specific
error messages.
2016-03-08 18:36:22 +00:00
Rebecca Law
29ddad60e7 Merge branch 'master' into forgot-password
Conflicts:
	app/main/views/two_factor.py
2016-03-08 15:03:25 +00:00
Rebecca Law
e735d772fe Added a test to check that the password is updated when the password exists in the session object on the two-factor page. 2016-03-08 14:58:29 +00:00
NIcholas Staples
b78a321d90 Merge pull request #238 from alphagov/show-invite-email
Show invite email
2016-03-08 08:49:00 +00:00
Adam Shimali
9bc5d08d52 Flash message to confirm invitation accepted and user has been
added to service.
2016-03-08 08:18:41 +00:00
Rebecca Law
3e969b3640 Re-implement forgot password 2016-03-07 18:18:52 +00:00
Martyn Inglis
5429107f93 Removed remember me checkbox
- remember me functionality always applied.
2016-03-07 14:39:20 +00:00
Adam Shimali
208a586948 Filter out accepted invites in template not client. 2016-03-07 13:59:54 +00:00
minglis
48a8be9ea4 Merge pull request #234 from alphagov/invite-permissions-status
[WIP] Add call to api to update invitation to accepted.
2016-03-04 16:18:20 +00:00
Rebecca Law
41b08b7ca1 Added from_user name and service name for the cancelled invitation message. 2016-03-04 15:17:04 +00:00
Rebecca Law
8074c6ea7f Add cancelled-invite html.
If a invited user accepts a cancelled invitation they are directed to a page telling them the invitation is cancelled.
Without this they were able to register and were added to the service.
2016-03-04 14:42:52 +00:00
Chris Hill-Scott
049004c1b3 Merge pull request #235 from alphagov/fix-bad-first-column
Validate column heading.
2016-03-04 11:38:57 +00:00
Rebecca Law
e1de40429c Merge pull request #231 from alphagov/add_manage_service_permission
Add manage service permission
2016-03-04 11:07:34 +00:00
Rebecca Law
f6db12b094 Merge pull request #227 from alphagov/poll-job-page
Make job page poll for updates
2016-03-04 11:07:14 +00:00
Rebecca Law
e3c692ede7 Validate column heading.
Still need to show that it is the heading that is wrong.
2016-03-04 10:09:46 +00:00
Adam Shimali
a974e6e157 [WIP] Add call to api to update invitation to accepted.
When flow for invited user is complete, that is
when user has been added to service, update invitation
to accepted
2016-03-03 18:13:56 +00:00
Adam Shimali
1ff9d671eb [WIP] pass invite instead of permissions to make update of invite easier if all goes well 2016-03-03 16:37:22 +00:00
Nicholas Staples
b3249831cf Fix up front end so you can navigate to the edit page. 2016-03-03 15:43:53 +00:00
Rebecca Law
3e1d60af86 Merge branch 'master' into revalidate-csv-file 2016-03-03 15:38:14 +00:00
Rebecca Law
35c3be5146 Add test.
Remove else since it is not needed.
2016-03-03 15:26:52 +00:00