Skip to content

Commit

Permalink
fix(models): avoid using deprecated pos args for save()
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Oct 21, 2024
1 parent a334e92 commit 17e1b0a
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions weblate_web/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,20 @@ def __str__(self):
return self.title

def save(
self, force_insert=False, force_update=False, using=None, update_fields=None
self,
*,
force_insert: bool = False,
force_update: bool = False,
using=None,
update_fields=None,
):
# Need to save first as rendered value is available only then
super().save(force_insert, force_update, using, update_fields)
super().save(
force_insert=force_insert,
force_update=force_update,
using=using,
update_fields=update_fields,
)
if not self.summary:
h2t = html2text.HTML2Text()
h2t.body_width = 0
Expand Down Expand Up @@ -860,9 +870,19 @@ def __str__(self):
return f"{self.package}: {self.service}"

def save(
self, force_insert=False, force_update=False, using=None, update_fields=None
self,
*,
force_insert: bool = False,
force_update: bool = False,
using=None,
update_fields=None,
):
super().save(force_insert, force_update, using, update_fields)
super().save(
force_insert=force_insert,
force_update=force_update,
using=using,
update_fields=update_fields,
)
self.service.update_status()

def get_absolute_url(self):
Expand Down Expand Up @@ -1005,9 +1025,19 @@ def __str__(self):
return self.site_url

def save(
self, force_insert=False, force_update=False, using=None, update_fields=None
self,
*,
force_insert: bool = False,
force_update: bool = False,
using=None,
update_fields=None,
):
super().save(force_insert, force_update, using, update_fields)
super().save(
force_insert=force_insert,
force_update=force_update,
using=using,
update_fields=update_fields,
)
self.service.discoverable = self.discoverable
self.service.site_url = self.site_url
self.service.site_title = self.site_title
Expand Down

0 comments on commit 17e1b0a

Please sign in to comment.