Beispiel #1
0
 def clean_slug(self):
     """
     Save the old slug to be used later in PageAdmin.save_model()
     to make the slug change propagate down the page tree, and clean
     leading and trailing slashes which are added on elsewhere.
     """
     self.instance._old_slug = self.instance.slug
     new_slug = self.cleaned_data['slug']
     if not isinstance(self.instance, Link) and new_slug != "/":
         new_slug = clean_slashes(self.cleaned_data['slug'])
     return new_slug
Beispiel #2
0
 def clean_slug(self):
     """
     Save the old slug to be used later in PageAdmin.save_model()
     to make the slug change propagate down the page tree, and clean
     leading and trailing slashes which are added on elsewhere.
     """
     self.instance._old_slug = self.instance.slug
     new_slug = self.cleaned_data['slug']
     if not isinstance(self.instance, Link) and new_slug != "/":
         new_slug = clean_slashes(self.cleaned_data['slug'])
     return new_slug