Ensuring more projections
This commit is contained in:
@@ -16,6 +16,7 @@ class Project(List, Find, Create, Post, Update, Delete, Replace):
|
||||
"""Project class wrapping the REST nodes endpoint
|
||||
"""
|
||||
path = "projects"
|
||||
ensure_query_projections = {'permissions': 1}
|
||||
|
||||
@classmethod
|
||||
def find_one(cls, params, api=None):
|
||||
@@ -26,6 +27,8 @@ class Project(List, Find, Create, Post, Update, Delete, Replace):
|
||||
|
||||
# Force delivery of only 1 result
|
||||
params['max_results'] = 1
|
||||
|
||||
cls._ensure_projections(params, cls.ensure_query_projections)
|
||||
url = utils.join_url_params(cls.path, params)
|
||||
|
||||
response = api.get(url)
|
||||
|
||||
@@ -183,6 +183,7 @@ class Find(Resource):
|
||||
|
||||
# Force delivery of only 1 result
|
||||
params['max_results'] = 1
|
||||
cls._ensure_projections(params, cls.ensure_query_projections)
|
||||
url = utils.join_url_params(cls.path, params)
|
||||
|
||||
response = api.get(url)
|
||||
|
||||
Reference in New Issue
Block a user