Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions #21

Merged
merged 11 commits into from
Jul 31, 2021
Merged

Exceptions #21

merged 11 commits into from
Jul 31, 2021

Conversation

ricardo8990
Copy link
Contributor

@ricardo8990 ricardo8990 commented Jun 3, 2021

  • Agrega excepciones similares a las que teníamos con Chalice para mantener consistencia
  • Cuando un parámetro de recurso llega como me lo sustituye por el user_id
  • No agrega el filtro user_id cuando no existe en el modelo
  • Se modifica copy_attributes para no sustituir atributos privados
  • Agrega al recurso delete el objeto Request. Requerido cuando necesitas acceder al cuerpo de la petición

@codecov
Copy link

codecov bot commented Jun 3, 2021

Codecov Report

Merging #21 (39dfd8c) into main (e6d9aab) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          138       148   +10     
  Branches        20        21    +1     
=========================================
+ Hits           138       148   +10     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
fast_agave/blueprints/decorators.py 100.00% <100.00%> (ø)
fast_agave/blueprints/rest_api.py 100.00% <100.00%> (ø)
fast_agave/exc.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6d9aab...39dfd8c. Read the comment docs.

@@ -25,13 +25,18 @@ def user_id_filter_required(self) -> bool:
async def retrieve_object(
self, resource_class: Any, resource_id: str
) -> Any:
resource_id = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test?

Copy link
Contributor Author

@ricardo8990 ricardo8990 Jun 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es el segundo punto del PR

@@ -76,18 +81,18 @@ def wrapper_resource_class(cls):

@self.delete(path + '/{id}')
@copy_attributes(cls)
async def delete(id: str):
async def delete(id: str, request: Request):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

porque sería necesario acceder al request desde estos métodos?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay situaciones donde el método delete tiene un tiempo de expiración en el body como aquí, este solo puede obtenerse del objeto Request

@felipao-mx felipao-mx merged commit 1e5a20a into main Jul 31, 2021
@felipao-mx felipao-mx deleted the exceptions branch September 22, 2021 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants