Leo Hemsted
444132ad66
rewrite weekly aggregate function to honor week boundaries
...
(and not use the stats table, and also be easier to read)
2016-07-26 17:23:59 +01:00
Leo Hemsted
fd96c854e1
add dao function to get notification stats for a server for toady only
2016-07-26 14:35:29 +01:00
Leo Hemsted
3b552139ce
add tests for dao
2016-07-21 14:04:25 +01:00
Leo Hemsted
67542280f5
remove unused user_id option from GET /service/<service_id>
2016-07-21 14:04:25 +01:00
Adam Shimali
e28ef237e4
When adding a user new with permissions to a service, the permissions
...
dao was deleting all permissions for that user (regardless of service
id) as the last filter on the permissions dao get_query method won.
I've added a replace flag to the set_user_service_permission method
so that it can handle adding new users + permissions and editing
of existing users' permissions.
Also by pass the get_query method until it can be refactored to work
correctly.
For now execute the filter query directly on the model.
2016-06-07 16:35:26 +01:00
Martyn Inglis
9617f0748b
Added some tests around creating and updated services
...
- ensure research mode is respected on creation and update
- ensure rest client gives an error for bad research mode update
2016-05-31 12:49:06 +01:00
Nicholas Staples
15607c0977
Add server_commands and update readme.md
...
Update command to search for services from the user.
2016-05-18 12:20:56 +01:00
Nicholas Staples
d40d9f76d4
Purge functional tests command added with passing test.
...
Code quality fix.
2016-05-06 11:16:30 +01:00
Adam Shimali
a6a18c1a6f
This approach uses part of sqlalchemy example history_meta code
...
adapted to recording inserts and updates.
This removes need to manually create history tables.
Our code still remains in control of when history records are
created.
2016-04-19 17:13:26 +01:00
Nicholas Staples
90f0505a3d
Update limit to message_limit.
...
Further db changes and updates.
Remove traceback print out.
Fix bug in passing template id to a task.
2016-04-11 16:53:40 +01:00
Rebecca Law
8df4919029
The admin app now sends the email from when creating a service and when updating the service name.
...
This PR removes the need for the email_safe function. The api does not create the email_from field for the service.
Tests were updated to reflect this change.
2016-03-31 17:46:18 +01:00
Rebecca Law
123b0ead3a
Replaced first queries with one queries, which throws a NoResultFound.
...
Able to remove many of the None checks as a result of this.
Fixed the tests were needed.
2016-03-11 15:34:20 +00:00
Rebecca Law
e055590b07
Changed db queries to use one, which throws NoResultFound exception, this exception is dealt with in our error handlers.
...
Now a lot of the if none checks can be removed.
2016-03-11 12:39:55 +00:00
Martyn Inglis
5bfae689c2
Refactored the services dao to be a little cleaner
...
- some things we don't need
- bulk update of users
- delete service
Now returns None if can't find an object
2016-02-19 15:53:15 +00:00
Rebecca Law
5a937d6e71
Added user_id as a query param for get_services.
...
Need to add this query param for the services page on the admin app.
Do not add the query param to path in the token.
2016-01-22 12:47:59 +00:00
Nicholas Staples
31f10c7457
Added delete endpoint and tests.
2016-01-12 10:39:49 +00:00
Nicholas Staples
74547013ba
All four http methods working now for user and service restful apis.
2016-01-11 17:19:06 +00:00
Nicholas Staples
49e98c21e7
Service and User API added, working with tests. Still need to polish the edges and add more tests.
2016-01-11 15:07:13 +00:00
Nicholas Staples
0bc4d02713
Work in progress, skeleton of the api created and testing started. Need to fix authentication tests.
2016-01-08 17:51:46 +00:00