Skip to content

Commit

Permalink
Merge the duplicate Party.save methods
Browse files Browse the repository at this point in the history
Both the social share image and search rewrite branches introduced a new Party.save method, causing the latter to hilariously override the former.
  • Loading branch information
gasman committed Jul 20, 2018
1 parent 3f3424b commit 5da3dee
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions parties/models.py
Expand Up @@ -115,7 +115,12 @@ def __unicode__(self):
return self.name

def save(self, *args, **kwargs):
# populate search_title from name
if self.name:
self.search_title = generate_search_title(self.name)

super(Party, self).save(*args, **kwargs)

if self.share_image_file_url and not self.share_image_file:
# clear the previous share_image_file_url field
Party.objects.filter(pk=self.pk).update(share_image_file_url='')
Expand Down Expand Up @@ -255,13 +260,6 @@ def index_components(self):
'C': self.asciified_location + ' ' + self.plaintext_notes,
}

def save(self, *args, **kwargs):
# populate search_title from name
if self.name:
self.search_title = generate_search_title(self.name)

return super(Party, self).save(*args, **kwargs)

class Meta:
verbose_name_plural = "Parties"
ordering = ("name",)
Expand Down

0 comments on commit 5da3dee

Please sign in to comment.