v1.0
This commit is contained in:
@@ -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
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user