* fixes created timestamp in detail views where modified needs to be displayed
* adds fallback timestamp if data has not been edited, yet --> show created timestamp
* fixes bug where deleting of certain data didn't redirect to the index view
* adds quality_check() method for EMA, needed for recording
* adds all functions which are provided for compensations to EMA
* adds/updates translations
This commit is contained in:
mipel
2021-08-19 13:44:06 +02:00
parent d1f43f8c64
commit 615b7bf5ea
18 changed files with 717 additions and 18 deletions

View File

@@ -257,9 +257,17 @@ class EcoAccount(AbstractCompensation):
y,
)
def quality_check(self) -> (bool, dict):
# ToDo
pass
def quality_check(self) -> list:
""" Quality check
Returns:
ret_msgs (list): Holds error messages
"""
ret_msgs = []
# ToDo: Add check methods!
return ret_msgs
class EcoAccountWithdraw(BaseResource):

View File

@@ -63,9 +63,9 @@
<tr>
<th scope="row">{% trans 'Last modified' %}</th>
<td class="align-middle">
{{obj.created.timestamp|default_if_none:""|naturalday}}
{{obj.modified.timestamp|default_if_none:""|naturalday}}
<br>
{{obj.created.user.username}}
{{obj.modified.user.username}}
</td>
</tr>
<tr>

View File

@@ -55,9 +55,9 @@
<tr>
<th scope="row">{% trans 'Last modified' %}</th>
<td class="align-middle">
{{obj.created.timestamp|default_if_none:""|naturalday}}
{{obj.modified.timestamp|default_if_none:""|naturalday}}
<br>
{{obj.created.user.username}}
{{obj.modified.user.username}}
</td>
</tr>
<tr>

View File

@@ -141,7 +141,7 @@ def remove_view(request: HttpRequest, id: str):
return form.process_request(
request=request,
msg_success=_("Compensation removed"),
redirect_url="",
redirect_url=reverse("compensation:index"),
)