Skip to content

Commit

Permalink
fix(activities): 활동 문제에는 자신이 등록한 문제만 추가할 수 있도록 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
hepheir committed Sep 29, 2024
1 parent f972697 commit b98060d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/apps/activities/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ def _new_problems(self, instance: models.CrewActivityDAO, problem_ref_ids: typin
for order, problem_ref_id in enumerate(problem_ref_ids, start=order_start_at):
obj = None
try:
problem = Problem.objects.get(
**{Problem.field_name.PK: problem_ref_id})
problem = Problem.objects \
.filter(**{Problem.field_name.CREATED_BY: self.get_authenticated_user()}) \
.get(**{Problem.field_name.PK: problem_ref_id})
except Problem.DoesNotExist:
raise validators.ValidationError(
f'Invalid problem_ref_id: {problem_ref_id}',
Expand Down

0 comments on commit b98060d

Please sign in to comment.