Skip to content

Commit

Permalink
made_a_constant
Browse files Browse the repository at this point in the history
  • Loading branch information
evg1995gon committed Sep 15, 2023
1 parent 2631592 commit 5bc5b29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/services/shift_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ async def finish_shift_automatically(self, bot: Application) -> None:
await self.__shift_repository.update(shift.id, shift)

if shift.status is Shift.Status.READY_FOR_COMPLETE:
if date.today() <= (shift.finished_at + timedelta(days=3)):
if date.today() <= (shift.finished_at + timedelta(days=settings.NUMBER_OF_DAYS_BEFORE_CLOSING_SHIFT)):
if not unreviewed_report_exists:
shift.status = Shift.Status.FINISHED
await self.__telegram_bot(bot).notify_that_shift_is_finished(shift)
Expand Down
3 changes: 3 additions & 0 deletions src/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class Settings(BaseSettings):
# Время жизни ссылки для приглашения на регистрацию
INVITE_LINK_EXPIRATION_TIME = timedelta(days=1)

# Количество дней после которого смена закроется автоматически
NUMBER_OF_DAYS_BEFORE_CLOSING_SHIFT = 3

# Директория для сохранения фотоотчётов
USER_REPORTS_DIR: Path = BASE_DIR / "static" / "user_reports"

Expand Down

0 comments on commit 5bc5b29

Please sign in to comment.