Commits

Francisco Souza  committed dcf1d27

Alteração no módulo signals.py

  • Participants
  • Parent commits 6b02364

Comments (0)

Files changed (1)

File util/signals.py

 def instrutor_pre_save(signal, instance, sender, **kwargs):
     if not instance.slug:
         slug = slugify(instance.nome)
-        novo_slug = slug
+        new_slug = slug
         count = 0
 
-        while sender.objects.filter(slug = novo_slug).exclude(id = instance.id).count() > 0:
+        while sender.objects.filter(slug = new_slug).exclude(id = instance.id).count() > 0:
             count += 1
-            novo_slug = '%s-%d' % (slug, count)
+            new_slug = '%s-%d' % (slug, count)
 
-        instance.slug = novo_slug
+        instance.slug = new_slug
 
 def curso_pre_save(signal, instance, sender, **kwargs):
     if not instance.slug:
         slug = slugify(instance.titulo)
-        novo_slug = slug
+        new_slug = slug
         count = 0
 
-        while sender.objects.filter(slug = novo_slug).exclude(id = instance.id).count() > 0:
+        while sender.objects.filter(slug = new_slug).exclude(id = instance.id).count() > 0:
             count += 1
-            novo_slug = '%s-%d' % (slug, count)
+            new_slug = '%s-%d' % (slug, count)
 
-        instance.slug = novo_slug
+        instance.slug = new_slug