diff --git a/RIGS/models.py b/RIGS/models.py index 824cb341..3fb482df 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -609,5 +609,9 @@ class RiskAssessment(models.Model): # Blimey that was a lot of options + @property + def activity_feed_string(self): + return str(self.event) + def __str__(self): - return "%i: %s" % (self.pk, self.event) + return "%i - %s" % (self.pk, self.event) diff --git a/assets/models.py b/assets/models.py index 0d552791..a13a71d4 100644 --- a/assets/models.py +++ b/assets/models.py @@ -176,18 +176,14 @@ class Asset(models.Model, RevisionMixin): errdict["csa"] = ["The CSA of a cable must be more than 0"] if not self.cable_type: errdict["cable_type"] = ["A cable must have a type"] - # if not self.circuits or self.circuits <= 0: - # errdict["circuits"] = ["There must be at least one circuit in a cable"] - # if not self.cores or self.cores <= 0: - # errdict["cores"] = ["There must be at least one core in a cable"] - # if self.socket is None: - # errdict["socket"] = ["A cable must have a socket"] - # if self.plug is None: - # errdict["plug"] = ["A cable must have a plug"] if errdict != {}: # If there was an error when validation raise ValidationError(errdict) + @property + def activity_feed_string(self): + return str(self) + @receiver(pre_save, sender=Asset) def pre_save_asset(sender, instance, **kwargs): diff --git a/versioning/templates/activity_feed_data.html b/versioning/templates/activity_feed_data.html index 4ef9f8a0..6f7e0fad 100644 --- a/versioning/templates/activity_feed_data.html +++ b/versioning/templates/activity_feed_data.html @@ -6,48 +6,44 @@ {% load to_class_name from filters %} {% block content %} -
-
- {% if version.changes.old == None %}
- Created
- {% else %}
- Changed {% include 'version_changes.html' %} in
- {% endif %}
+
+
+ {% if version.changes.old == None %}
+ Created
+ {% else %}
+ Changed {% include 'version_changes.html' %} in
+ {% endif %}
- {% include 'object_button.html' with object=version.changes.new %}
- {% if version.revision.comment %}
- ({{ version.revision.comment }})
- {% endif %}
-
-
+
+ {% endif %}
+
+ {{ version.revision.user.name }}
+ {{version.revision.date_created|naturaltime}}
+
+ {% endif %}
+