This commit is contained in:
Felix Baumann
2026-06-28 10:20:36 +00:00
parent 64b32d0b44
commit 148efd919d
86 changed files with 2475 additions and 760 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# Generated by Django 6.0.6 on 2026-06-27 17:19
# Generated by Django 6.0.6 on 2026-06-28 10:19
import django.db.models.deletion
from django.conf import settings
+11 -1
View File
@@ -1,6 +1,6 @@
from django.db import models
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
User = get_user_model()
@@ -71,6 +71,16 @@ class TimeEntry(models.Model):
def __str__(self):
return f"{self.user} - {self.start:%d.%m.%Y} - {self.duration_hours} Stunden"
def clean(self):
if self.start and self.end and self.start >= self.end:
raise ValidationError({
'end': 'Das Ende muss nach dem Start liegen.'
})
def save(self, *args, **kwargs):
self.full_clean()
super().save(*args, **kwargs)
@property
def duration_minutes(self):
@@ -19,7 +19,7 @@ Zeiten erfassen und verwalten
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4">
<div>
<h2 class="text-xl font-bold">
<h2 class="text-lg font-bold">
Aktionen
</h2>
@@ -59,7 +59,7 @@ Zeiten erfassen und verwalten
<div class="mb-6">
<h2 class="text-xl font-bold">
<h2 class="text-lg font-bold">
Zeiterfassungen
</h2>