Skip to content

Commit

Permalink
fix(backend): projects can't be created in django-admin (#229)
Browse files Browse the repository at this point in the history
ref: #228
  • Loading branch information
c0rydoras authored and MitanOmar committed Jun 3, 2024
1 parent 3687fbf commit aa017cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/timed/projects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TaskInlineFormset(BaseInlineFormSet):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
project = kwargs["instance"]
if project.tasks.count() == 0:
if not project.pk or project.tasks.count() == 0:
self.initial = [
{"name": tmpl.name}
for tmpl in models.TaskTemplate.objects.order_by("name")
Expand Down

0 comments on commit aa017cb

Please sign in to comment.