Skip to content

Commit

Permalink
update slug only if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rafammpp committed Jun 27, 2023
1 parent 8117868 commit f2a3e60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions autoslug/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ def pre_save(self, instance, add):
# get currently entered slug
value = self.value_from_object(instance)

if not self.always_update and value:
return value

if self.manager is not None:
manager = self.manager
elif self.manager_name is not None:
Expand Down

0 comments on commit f2a3e60

Please sign in to comment.