Skip to content

Commit

Permalink
Merge pull request #388 from fearless-spider/master
Browse files Browse the repository at this point in the history
Update admin_forms.py
  • Loading branch information
fearless-spider committed Jun 22, 2023
2 parents 9e0573b + a5f5761 commit c9d7bf2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions newsletter/admin_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

assert self.instance
next_sortorder = self.instance.get_next_article_sortorder()
for index, form in enumerate(self.extra_forms):
form.initial['sortorder'] = next_sortorder + index * 10
if self.instance.pk:
next_sortorder = self.instance.get_next_article_sortorder()
for index, form in enumerate(self.extra_forms):
form.initial['sortorder'] = next_sortorder + index * 10

0 comments on commit c9d7bf2

Please sign in to comment.