Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ exclude = [ "**/migrations", "**/_reportlab.py", "**/tests.py"]
typeCheckingMode = "standard"
deprecateTypingAliases = true
pythonVersion = "3.13"

[tool.coverage.run]
branch = true
source = [
"src",
]
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ django==5.2.8
# via
# django-telegram-app
# ida (pyproject.toml)
django-telegram-app==0.2.0
django-telegram-app==0.3.0
# via ida (pyproject.toml)
django-types==0.22.0
# via ida (pyproject.toml)
Expand Down
2 changes: 1 addition & 1 deletion requirements/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ django==5.2.8
# via
# django-telegram-app
# ida (pyproject.toml)
django-telegram-app==0.2.0
django-telegram-app==0.3.0
# via ida (pyproject.toml)
envyronment==0.4.0
# via ida (pyproject.toml)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
from django.utils import timezone
from django_telegram_app.management.base import BaseTelegramCommand

from apps.timesheets.telegrambot.commands.completetimesheet import Command as CompleteTimesheetCommand


class Command(BaseTelegramCommand):
"""Start the CompleteTimesheet command."""

help = "Start the CompleteTimesheet command to let users complete their timesheets."
command_text = "/completetimesheet"
command = CompleteTimesheetCommand

def should_run(self):
"""Only run the command if it's the last day of the month."""
Expand Down
4 changes: 3 additions & 1 deletion src/apps/timesheets/management/commands/startregisterwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
from django.utils import timezone
from django_telegram_app.management.base import BaseTelegramCommand

from apps.timesheets.telegrambot.commands.registerwork import Command as RegisterWorkCommand


class Command(BaseTelegramCommand):
"""Start a RegisterWork command."""

help = "Start a RegisterWork command to let users register their work hours."
command_text = "/registerwork"
command = RegisterWorkCommand

def should_run(self):
"""Only run on weekdays."""
Expand Down
3 changes: 1 addition & 2 deletions src/apps/timesheets/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from django.core.exceptions import ValidationError
from django.core.management import call_command
from django.test import TestCase
from django_telegram_app import get_telegram_settings_model
from django_telegram_app.bot import get_commands, load_command_class
from django_telegram_app.bot.testing.testcases import TelegramBotTestCase
from django_telegram_app.resolver import get_telegram_settings_model

from apps.projects.models import Project
from apps.timesheets.models import TimeRangeItemTypeRule, Timesheet, TimesheetItem, WeekdayItemTypeRule
Expand Down Expand Up @@ -129,7 +129,6 @@ class TimesheetsTelegramBotTestCase(TelegramBotTestCase):
@classmethod
def setUpTestData(cls):
"""Set up the test data."""
super().setUpTestData()
cls.timesheet = Timesheet.objects.get(pk=1)
cls.user = get_user_model().objects.get(pk=1)
cls.project = Project.objects.get(pk=1)
Expand Down