Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

Commit

Permalink
Show friendly version of recommendation in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinthehole committed Jul 31, 2013
1 parent 21a84be commit 47acfa0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions datacash/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,13 @@ def order_number(self):
class
"""
return self.merchant_order_ref.split("_")[0]

@property
def recommendation_text(self):
mapping = {
self.RELEASE: "Released",
self.HOLD: "On hold",
self.REJECT: "Rejected",
self.UNDER_INVESTIGATION: "Under investigation",
}
return mapping.get(self.recommendation, "Unknown")
4 changes: 2 additions & 2 deletions datacash/templates/datacash/dashboard/fraudresponse_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
</thead>
<tbody>
{% for r in responses %}
<tr {% if r.released %}class="success"{% elif txn.hold %}class="warning"{% else %}class="error"{% endif %}>
<tr {% if r.released %}class="success"{% elif r.on_hold %}class="warning"{% else %}class="error"{% endif %}>
<td>{{ r.t3m_id }}</td>
<td>{{ r.merchant_order_ref }}</td>
<td><a href="{% url dashboard:order-detail r.order_number %}">{{ r.order_number }}</a></td>
<td>{{ r.aggregator_identifier|default:"-" }}</td>
<td>{{ r.merchant_identifier }}</td>
<td>{{ r.score }}</td>
<td>{{ r.recommendation }}</td>
<td>{{ r.recommendation_text }}</td>
<td>{{ r.date_created }}</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit 47acfa0

Please sign in to comment.