summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py14
-rw-r--r--ishtar_common/templates/ishtar/sheet_organization.html1
-rw-r--r--ishtar_common/templates/ishtar/sheet_person.html1
3 files changed, 5 insertions, 11 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 4e05a115f..1aaaf933a 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -453,17 +453,6 @@ class BaseHistorizedItem(models.Model):
except IndexError:
return
- @property
- def created_by(self):
- q = self.history.order_by('history_date')
- if not q.count():
- return
- try:
- modifier = IshtarUser.objects.get(pk=q.all()[0].history_modifier_id)
- return modifier.person
- except IshtarUser.DoesNotExist:
- return
-
def rollback(self, date):
"""
Rollback to a previous state
@@ -882,6 +871,9 @@ class IshtarUser(User):
def has_right(self, right_name):
return self.person.has_right(right_name)
+ def full_label(self):
+ return self.person.full_label()
+
class AuthorType(GeneralType):
class Meta:
verbose_name = _(u"Author type")
diff --git a/ishtar_common/templates/ishtar/sheet_organization.html b/ishtar_common/templates/ishtar/sheet_organization.html
index e58d84887..c5f01b96a 100644
--- a/ishtar_common/templates/ishtar/sheet_organization.html
+++ b/ishtar_common/templates/ishtar/sheet_organization.html
@@ -10,6 +10,7 @@
<div class='tool'>{%trans "Export as:"%} <a href='{% url show-organization item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-organization item.pk "pdf" %}'>{%trans "PDF file"%}</a></div>
<p><label>{% trans "Name" %}</label> <span class='value'>{{item.name}}</span></p>
+<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
{% if item.address %}<p><label>{% trans "Address" %}</label> <span class='value'>{{item.address}}</span></p> {% endif %}
{% if item.address_complement %}<p><label>{% trans "Address complement" %}</label> <span class='value'>{{item.address_complement}}</span></p> {% endif %}
{% if item.postal_code %}<p><label>{% trans "Postal code" %}</label> <span class='value'>{{item.postal_code}}</span></p> {% endif %}
diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html
index 1fc31ac23..b6bf99d56 100644
--- a/ishtar_common/templates/ishtar/sheet_person.html
+++ b/ishtar_common/templates/ishtar/sheet_person.html
@@ -11,6 +11,7 @@
<p><label>{% trans "Name" %}</label> <span class='value'>{{item.name}}</span></p>
<p><label>{% trans "Surname" %}</label> <span class='value'>{{item.surname}}</span></p>
+<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
{% if item.email %}<p><label>{% trans "Email" %}</label> <span class='value'>{{item.email}}</span></p>{% endif %}
<p><label>{% trans "Type(s)" %}</label> <span class='value'>{{item.person_types_list}}</span></p>
{% if item.address %}<p><label>{% trans "Address" %}</label> <span class='value'>{{item.address}}</span></p> {% endif %}