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

Ограничения на поля оценок #29

Conversation

gitfresnel
Copy link
Contributor

Изменения

Добавил ограничения для полей оценок

Детали реализации

Check-List

  • Вы проверили свой код перед отправкой запроса?
  • Вы написали тесты к реализованным функциям?
  • Вы не забыли применить форматирование black и isort для Back-End или Prettier для Front-End?

@gitfresnel gitfresnel linked an issue Nov 2, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Nov 2, 2024

Code Coverage

Coverage Report
FileStmtsMissCoverMissing
rating_api
   __main__.py440%1–7
   exceptions.py26388%35–36, 44
rating_api/models
   base.py55787%24–27, 45, 53, 74
rating_api/routes
   comment.py662858%28, 34–37, 85–108, 125–128, 142
   exc_handlers.py20290%26, 33
   lecturer.py883165%55, 104–145, 159, 167, 185, 191
rating_api/schemas
   base.py12467%6–9
TOTAL4167981% 

Summary

Tests Skipped Failures Errors Time
9 0 💤 0 ❌ 0 🔥 0.768s ⏱️

@classmethod
def validate_mark(cls, value):
if value not in [-2, -1, 0, 1, 2]:
raise ValueError('оценка может принимать только значения: -2, -1, 0, 1, 2')
Copy link
Member

Choose a reason for hiding this comment

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

давай свой exception создадим и handler к нему

@Temmmmmo Temmmmmo merged commit cd8370b into main Nov 7, 2024
2 checks passed
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