def save(self, *args, **kwargs):
        # save so we have a pk for new records
        if not self.pk:
            super(Job, self).save(*args, **kwargs)

        # if we're resaving an existing record, strip the pk
        # off the front so we don't end up multiplying them
        slug_prefix = '%s-' % self.pk
        if self.slug.startswith(slug_prefix):
            self.slug = self.slug.replace(slug_prefix, '')
            
        if self.slug == '':
            self.slug = slugify(self.name)[:40]
        
        # prefix with pk
        self.slug = '%s%s' % (slug_prefix, self.slug)

        # call this manually because of the double-save for slugging
        clear_caches_for_job(self)

        super(Job, self).save(*args, **kwargs)
prepend pk to job slug to keep things unique
dataset/ETHPy150Open mozilla/source/source/jobs/models.py/Job.save