Skip to content

Commit

Permalink
upgrade to django 4.1, fix Project.save() (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Jan 8, 2024
1 parent 36c89e4 commit 15bdcce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions projectroles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,16 @@ def save(self, *args, **kwargs):
self._validate_archive()
# Update full title of self and children
self.full_title = self._get_full_title()
# TODO: Save with commit=False with other args to avoid double save()?
super().save(*args, **kwargs)
if self.type == PROJECT_TYPE_CATEGORY:
for child in self.children.all():
child.save()
# Update public children
# NOTE: Parents will be updated in ProjectModifyMixin.modify_project()
self.has_public_children = self._has_public_children()
super().save(*args, **kwargs)
if self._has_public_children():
self.has_public_children = True
super().save(*args, **kwargs)

def _validate_parent(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ setuptools>=67.6.0, <67.7
packaging>=23.0, <24.0

# Django
django==4.0.10
django==4.1.13

# Configuration
django-environ>=0.10.0, <0.11
Expand Down

0 comments on commit 15bdcce

Please sign in to comment.