Commit e6805e9a authored by BAIRE Anthony's avatar BAIRE Anthony

Add timestamp to user agreements

parent ef1a3cd1
......@@ -642,6 +642,7 @@ class UserAgreement(BaseModel):
"""
tos = models.ForeignKey('Tos', on_delete=models.CASCADE, related_name='tos')
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_agreement')
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return "{0} - {1}".format(self.user, self.tos)
......
......@@ -938,7 +938,7 @@ class UserNeedValidation(LoginRequiredMixin, DetailView):
# last ToS agreement by the user
agreement = UserAgreement.objects.filter(user=self.request.user
).order_by("-id").first()
).order_by("-created_at").first()
# next ToS to be signed
next_tos = Tos.get_latest()
......
......@@ -61,7 +61,7 @@
<i>(previous)</i>
{% endif %}
</td>
<td class="text-success"><i>Agreed</i></td>
<td class="text-success"><i>Agreed on {{agreement.created_at}}</i></td>
<td/>
</tr>
{% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment