Skip to content

Feature/user search - #102

Open
juanNH wants to merge 3 commits into
devfrom
feature/user-search
Open

Feature/user search#102
juanNH wants to merge 3 commits into
devfrom
feature/user-search

Conversation

@juanNH

@juanNH juanNH commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/api_service/views.py

experiment = get_object_or_404(Experiment, id=experiment_id)
if not can_edit_shared_resource(experiment, request.user):
return Response(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

En vez de devolver un Response con 403, hacer un raise PermissionError("You do not ...") para que DRF lo ataje nativamente sin tanto verbose

Comment thread src/biomarkers/views.py
)

biomarker = get_object_or_404(Biomarker, id=biomarker_id)
if not can_edit_shared_resource(biomarker, request.user):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Idem comentario anterior

Comment thread src/biomarkers/views.py
biomarker = get_object_or_404(Biomarker, id=biomarker_id)
if biomarker.user.id != request.user.id:
if not can_edit_shared_resource(biomarker, request.user):
return Response(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Idem comntario anterior

Comment thread src/biomarkers/views.py
biomarker = get_object_or_404(Biomarker, id=biomarker_id)
if biomarker.user.id != request.user.id:
if not can_edit_shared_resource(biomarker, request.user):
return Response(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Idem comentario anterior

Comment thread src/biomarkers/views.py

biomarker = get_object_or_404(Biomarker, id=biomarker_id)
if not can_edit_shared_resource(biomarker, request.user):
return Response(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Idem comentario anterior

"""REST endpoint: delete for StatisticalValidation model."""

def get_queryset(self):
if self.request.method == 'GET':

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Explicar por qué se hace esta distinción entre GET y POST

biomarker__user=request.user)
stat_validation = get_object_or_404(StatisticalValidation, pk=pk)
if not can_view_biomarker(stat_validation.biomarker, request.user):
raise ValidationError('You do not have permission to access this statistical validation.')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Es PermissionDenied en vez de ValidationError. Corregir en los demas casos del archivo

Comment thread src/user_files/views.py
"""

def get_queryset(self):
if self.request.method == 'GET':

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Idem comentario sobr el GET

Comment thread src/user_files/views.py

user_file = get_object_or_404(UserFile, pk=user_file_id)
if not can_edit_shared_resource(user_file, request.user):
return Response(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Arrojar PermissionDenied Corregir en los demas casos del archivo

Comment thread src/user_files/views.py

institution = get_object_or_404(Institution, pk=institution_id)
if not user_file.institutions.filter(pk=institution.pk).exists():
return Response(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Arrojar un ValidationError acá

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants