Commits

Lucian Brănescu-Mihăilă committed 8b50c4c

Add a couple of comments.

Comments (0)

Files changed (1)

                                     .filter(slug__startswith=potential)]
 
         if not potential in slugs:
+            # derived slug is unique
             return potential
 
         similar = re.compile(r'^{0}-(\d+)$'.format(potential))
         collision_numbers = [int(i.groups()[0]) for i in slug_matches if i]
 
         if len(collision_numbers) == 0:
+            # this is the first collision
+            # start at two for the poor humans
             next_number = 2
         else:
             next_number = max(collision_numbers) + 1
         if not self.slug:
            self.slug = self.get_unique_slug(self.title)
 
-
         super(Blog, self).save(*args, **kwargs)