summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html2
-rw-r--r--archaeological_files/templates/ishtar/sheet_file.html2
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html1
-rw-r--r--archaeological_operations/templates/ishtar/sheet_administrativeact.html2
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html2
-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
8 files changed, 10 insertions, 15 deletions
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index 95a44116d..acc0db718 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -30,7 +30,7 @@
{%endif%}
<span class='value'>{{item.full_label}}</span></p>
<p><label>{%trans "Creation date:"%}</label> <span class='value'>{{ item.creation_date }}</span></p>
-<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.created_by.full_label }}</span></p>
+<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
{%if item.unit %}
<p><label>{% trans "Type:" %}</label> <span class='value'>{{ item.unit }}</span></p>
{%endif%}
diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html
index dddae309b..ffbf0018f 100644
--- a/archaeological_files/templates/ishtar/sheet_file.html
+++ b/archaeological_files/templates/ishtar/sheet_file.html
@@ -31,7 +31,7 @@
<p><label>{%trans "Edition date:"%}</label> <span class='value'>{{ item.history_date }}</span></p> <!-- date = now -->
{% if item.reception_date %}<p><label>{%trans "Reception date:"%}</label> <span class='value'>{{ item.reception_date }}</span></p>{% endif %}
<p><label>{%trans "Creation date:"%}</label> <span class='value'>{{ item.creation_date }}</span></p>
-<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.created_by.full_label }}</span></p>
+<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
{% comment %}
{% if item.deadline_date and not item.acts %}
<p><label>{%trans "Deadline:"%}</label> <span class='value'>{% item.deadline_date %}</span></p> <!-- calculated deadline for some preventive files , see saisine_type, not displayed if an act as been send -->
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index 89f335e1a..0e5ddfac0 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -32,6 +32,7 @@
<span class='value'>{{item.label}}</span></p>
{% if item.description %}<p><label>{%trans "Description"%}{% trans ":"%}</label>
<span class='value'>{{item.description}}</span></p>{% endif%}
+<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
<p><label>{%trans "Material type"%}{% trans ":"%}</label>
<span class='value'>{{item.material_type}}</span></p>
<p><label>{%trans "Dating"%}{% trans ":"%}</label>
diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact.html b/archaeological_operations/templates/ishtar/sheet_administrativeact.html
index 2cceb0222..0457d9260 100644
--- a/archaeological_operations/templates/ishtar/sheet_administrativeact.html
+++ b/archaeological_operations/templates/ishtar/sheet_administrativeact.html
@@ -21,7 +21,7 @@
{% if item.operation %}<p><label>{%trans "Associated operation:"%}</label> <span class='value'><a href='#' onclick='load_window("{% url show-operation item.operation.pk ''%}")'>{{ item.operation }}</a></span></p>{% endif %} <!-- Displayed as Year/index/Commune/Common_name This should be a link to the file sheet of the related operation -->
{% if item.operation %}{% if item.operation.surface %}<p><label>{%trans "Surface:"%}</label> <span class='value'>{{ item.operation.surface }} m<sup>2</sup> ({{ item.operation.surface_ha }} ha)</span></p>{%endif%} {% endif %}
-<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.created_by.full_label }}</span></p>
+<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
{%comment%}{% if item.general_contractor.attached_to %}<p><label>{%trans "General contractor organisation:"%}</label> <span class='value'>{{ item.general_contractor.attached_to }}</span></p>{% endif %} <!-- Contractor's organisation displayed as concat of Name/Adress/postal_code/city -->
{% if item.general_contractor %}<p><label>{%trans "General contractor:"%}</label> <span class='value'>{{ item.general_contractor.full_label }}</span></p>{% endif %}
{%endcomment%}
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index fe92314c2..0fd2a1076 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -34,7 +34,7 @@
<p class='alert'>{%trans "Patriarche OA code not yet recorded!"%}</p>{%endif%}
<p><label>{%trans "Edition date:"%}</label> <span class='value'>{{ item.history.all.0.history_date }}</span></p> <!-- date = now -->
-<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.created_by.full_label }}</span></p>
+<p><label>{%trans "Created by:"%}</label> <span class='value'>{{ item.history_creator.ishtaruser.full_label }}</span></p>
{% if item.start_date %}<p><label>{%trans "Begining date:"%}</label> <span class='value'>{{ item.start_date }}</span></p>
<p><label>{%trans "Excavation end date:"%}</label> <span class='value'>{{ item.excavation_end_date|default:"-" }}</span></p>
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 %}