Commits

Alexander Popelnukhin  committed 5c79838

Fix error

  • Participants
  • Parent commits 6fe5f52

Comments (0)

Files changed (1)

File students/models.py

 def model_save_signal(sender, instance, signal, *args, **kwargs):
     h = Log()
     h.model = str(sender)
-    h.log = 'Object <%s> with ID <%d> ' % (instance, instance.pk)
+
 
     try:
         sender.objects.get(pk=instance.pk)
         h.type = 'M'
-        h.log += 'modified'
+        h.log = 'modified'
 
     except sender.DoesNotExist:
         h.type = 'C'
-        h.log += 'created'
-        
+        h.log = 'created'
+
+    h.log = 'Object <%s> ' % instance + h.log
     h.save()
 
 
     h = Log()
     h.model = str(sender)
     h.type = 'D'
-    h.log = 'Object <%s> with ID <%d> was deleted' % (instance, instance.pk)
+    h.log = 'Object <%s> was deleted' % instance
     h.save()