Browse Source

Also display subscription ref in log

Alexandre Aubin 7 years ago
parent
commit
756f621044
1 changed files with 5 additions and 4 deletions
  1. 5 4
      coin/configuration/models.py

+ 5 - 4
coin/configuration/models.py

@@ -143,21 +143,22 @@ def subnet_event(sender, **kwargs):
         if hasattr(config, 'subnet_event'):
             config.subnet_event()
 
-        offer = config.offersubscription.offer
+        offer = config.offersubscription.offer.name
+        subref = config.offersubscription.get_subscription_reference()
         member = config.offersubscription.member
         ip = subnet.inet
 
         if kwargs['signal_type'] == "save":
-            msg = "Allocating IP %s to member %s (%s - %s %s) for offer %s"
+            msg = "Allocating IP %s to member %s (%s - %s %s) (for offer %s, %s)"
         elif kwargs['signal_type'] == "delete":
-            msg = "Deallocating IP %s from member %s (%s - %s %s) (was offer %s)"
+            msg = "Deallocating IP %s from member %s (%s - %s %s) (was offer %s, %s)"
         else:
             # Does not happens
             msg = ""
 
         subnet_log.info(msg % (ip, str(member.pk),
                         member.username, member.first_name, member.last_name,
-                        offer.name))
+                        offer, subref))
 
     except ObjectDoesNotExist:
         pass