feat: added material to model and form
This commit is contained in:
@@ -85,7 +85,11 @@ class TicketDetailUpdateView(UpdateView):
|
||||
is_assigned_tutor = user == self.ticket.assigned_to
|
||||
is_superuser = user.is_superuser
|
||||
|
||||
self.can_edit = is_assigned_tutor or is_superuser
|
||||
# Nur Autor und Admin kann Tickets bearbeiten
|
||||
if self.ticket.status == "closed" and not is_superuser:
|
||||
self.can_edit = False
|
||||
else:
|
||||
self.can_edit = is_assigned_tutor or is_superuser
|
||||
|
||||
# Zusätzliche Flags für Template
|
||||
self.is_creator = is_creator
|
||||
@@ -122,7 +126,7 @@ class TicketDetailUpdateView(UpdateView):
|
||||
response = super().form_valid(form) # Speichert das Ticket
|
||||
|
||||
# History tracking für geänderte Felder
|
||||
tracked_fields = ["title", "description", "status", "priority", "course", "answer"]
|
||||
tracked_fields = ["title", "description", "status", "priority", "course", "answer", "material"]
|
||||
for field in tracked_fields:
|
||||
if field in form.changed_data:
|
||||
old_value = getattr(original, field)
|
||||
|
||||
Reference in New Issue
Block a user