move get_all_notifications_for_service and get_all_notifications_for_job

moved from notifications/rest -> service/rest and job/rest respectively
endpoint routes not affected
removed requires_admin decorator - that should be set by nginx config
as opposed to python code
This commit is contained in:
Leo Hemsted
2016-06-28 15:17:36 +01:00
parent 848858f4e4
commit 2b645f490a
8 changed files with 225 additions and 265 deletions

13
app/utils.py Normal file
View File

@@ -0,0 +1,13 @@
from flask import url_for
def pagination_links(pagination, endpoint, **kwargs):
if 'page' in kwargs:
kwargs.pop('page', None)
links = dict()
if pagination.has_prev:
links['prev'] = url_for(endpoint, page=pagination.prev_num, **kwargs)
if pagination.has_next:
links['next'] = url_for(endpoint, page=pagination.next_num, **kwargs)
links['last'] = url_for(endpoint, page=pagination.pages, **kwargs)
return links