Skip to content

Commit

Permalink
überspringe Tasks ohne Datum
Browse files Browse the repository at this point in the history
  • Loading branch information
dewenni committed Feb 17, 2025
1 parent ec3c06e commit 58b5a31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ def has_new_tasks(current_tasks, last_tasks):

# Vergleiche die Titel, Daten und Fächer der Aufgaben
for current_task, last_task in zip(current_tasks, last_tasks):

date_string = last_task.get('date')
if date_string is None:
continue

# Konvertiere das gespeicherte Datum (String) in ein datetime-Objekt
last_task_date = datetime.strptime(last_task.get('date'), '%Y-%m-%d %H:%M:%S')
last_task_date = datetime.strptime(date_string, '%Y-%m-%d %H:%M:%S')

if (current_task.title != last_task.get('title') or
current_task.date != last_task_date or
Expand Down
3 changes: 1 addition & 2 deletions changeNew.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ Es kann jedoch gerne schon genutzt und getestet werden.

## changelog

- Logging angepasst (Zeitstempel ergänzt)
- Anhänge bei Hausaufgaben mit ausgeben
- überspringe Tasks ohne Datum

0 comments on commit 58b5a31

Please sign in to comment.