Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
felipao-mx committed Jan 10, 2022
1 parent 77b7f38 commit a0ff2d0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fast_agave/blueprints/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def current_user_id(self) -> str:
return context['user_id']

@property
def platform_id(self) -> str:
def current_platform_id(self) -> str:
return context['platform_id']

def user_id_filter_required(self) -> bool:
Expand All @@ -36,11 +36,10 @@ async def retrieve_object(
self.current_user_id if resource_id == 'me' else resource_id
)
query = Q(id=resource_id)
breakpoint()
if self.platform_id_filter_required() and hasattr(
resource_class.model, 'platform_id'
):
query = query & Q(platform_id=self.platform_id)
query = query & Q(platform_id=self.current_platform_id)

if self.user_id_filter_required() and hasattr(
resource_class.model, 'user_id'
Expand Down Expand Up @@ -190,7 +189,7 @@ async def query(request: Request):
return Response(content=e.json(), status_code=400)

if self.platform_id_filter_required():
query_params.platform_id = self.platform_id
query_params.platform_id = self.current_platform_id

if self.user_id_filter_required():
query_params.user_id = self.current_user_id
Expand Down

0 comments on commit a0ff2d0

Please sign in to comment.