Skip to content

Feature/user search - #102

Merged
Genarito merged 4 commits into
devfrom
feature/user-search
Aug 12, 2026
Merged

Feature/user search#102
Genarito merged 4 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 Outdated

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 Outdated
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 Outdated
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 Outdated

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

Comment thread src/statistical_properties/views.py Outdated
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 Outdated

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á

@Genarito
Genarito merged commit 6cbc816 into dev Aug 12, 2026
1 check passed
@Genarito
Genarito deleted the feature/user-search branch August 12, 2026 14:19
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