Skip to content

Conversation

@ji-min0
Copy link
Collaborator

@ji-min0 ji-min0 commented Dec 12, 2025

✅ PR 요약

📄 상세 내용

  • 시험 배포 서비스코드 작성
  • 시험 배포 베리데이션 코드 수정
  • 시험 배포 시리얼라이저 코드 수정

🧪 PR Checklist

  • ValidationError를 dict 기반으로 통일했습니다.
  • 시간 검증 로직을 함수로 분리했습니다.
  • key값 조회 → .get()으로 변경
  • 서비스에서 진행하던 유효성 검증 삭제했습니다 → view에서 진행할 예정

@ji-min0 ji-min0 linked an issue Dec 12, 2025 that may be closed by this pull request
4 tasks
@ji-min0 ji-min0 changed the base branch from main to develop December 12, 2025 06:14
@ji-min0 ji-min0 force-pushed the feature/58-exam-deployment-service branch from 98ff653 to 2e7a894 Compare December 12, 2025 06:16
@ji-min0 ji-min0 closed this Dec 12, 2025
@ji-min0 ji-min0 reopened this Dec 12, 2025
@ji-min0 ji-min0 force-pushed the feature/58-exam-deployment-service branch from 2e7a894 to 2f59487 Compare December 12, 2025 07:44
@ji-min0 ji-min0 closed this Dec 12, 2025
@ji-min0 ji-min0 reopened this Dec 12, 2025
@ji-min0 ji-min0 force-pushed the feature/58-exam-deployment-service branch from 2f59487 to 308b5cd Compare December 12, 2025 07:57
Copy link
Collaborator

@Meoyoug Meoyoug left a comment

Choose a reason for hiding this comment

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

코멘트 사항 수정하고 푸시 부탁드립니다.

@ji-min0 ji-min0 closed this Dec 12, 2025
@ji-min0 ji-min0 reopened this Dec 12, 2025
@ji-min0 ji-min0 force-pushed the feature/58-exam-deployment-service branch 2 times, most recently from 14ba3b8 to d2586dc Compare December 12, 2025 19:25
@ji-min0 ji-min0 closed this Dec 15, 2025
@ji-min0 ji-min0 reopened this Dec 15, 2025
- ValidationError를 string에서 dict로 변경
- 검증 함수로 묶어서 함수호출로 변경
- try-except로 non_field_error로 묶지않고 DeploymentValidator에서 발생시킨 예외 그대로 raise되도록 변경
- try-except로 non_field_error로 묶지않고 DeploymentValidator에서 발생시킨 예외 그대로 raise되도록 변경
- validate_not_closed 함수 제거
- exam - cohort 관계 검증 코드 서비스에서 시리얼라이저로 이동
- view에서 검증하도록 할 예정
@ji-min0 ji-min0 force-pushed the feature/58-exam-deployment-service branch from d2586dc to 322c6a8 Compare December 15, 2025 06:22
@ji-min0 ji-min0 closed this Dec 15, 2025
@ji-min0 ji-min0 reopened this Dec 15, 2025
@ji-min0 ji-min0 requested a review from Meoyoug December 15, 2025 06:56
@ji-min0 ji-min0 closed this Dec 15, 2025
@ji-min0 ji-min0 reopened this Dec 15, 2025
Comment on lines +135 to +138
for field, value in data.items():
if field not in allowed_fields:
raise ValidationError({"field": "수정할 수 없는 필드입니다."})
setattr(deployment, field, value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

시리얼라이저의 기본 동작 중에 선언되지 않은 필드에 대해서 키-밸류가 전달되면 해당 데이터는 무시되고 validate를 진행한 후에 validated_data가 생성됩니다

validated_data를 활용한다면 불필요한 절인 것 같아요

Comment on lines +154 to +163
def test_set_status_after_closed(self) -> None:
deployment = self._create_default_deployment()
self._force_closed(deployment)

updated = set_deployment_status(
deployment=deployment,
status=DeploymentStatus.DEACTIVATED,
)

self.assertEqual(updated.status, DeploymentStatus.DEACTIVATED)
Copy link
Collaborator

Choose a reason for hiding this comment

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

요구사항 정의서 보시면 종료된 시험은 상태 변경 불가입니다.
테스트 코드에도 추가하셔서 테스트 진행해주세요

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.

[feature] exam deployment service

4 participants