diff --git a/models.py b/models.py index dacd021..a3d72ae 100644 --- a/models.py +++ b/models.py @@ -375,6 +375,13 @@ class IP(models.Model): verbose_name = "IP" verbose_name_plural = "IPs" + @property + def last_used_formatted(self): + if self.last_used: + return self.last_used + else: + return "N/A" + @property def associated(self): ips = IP.objects.filter(ip=self.ip) diff --git a/templates/minecraft_manager/ip.html b/templates/minecraft_manager/ip.html index ec1023e..c8e51ac 100644 --- a/templates/minecraft_manager/ip.html +++ b/templates/minecraft_manager/ip.html @@ -14,7 +14,7 @@ {% for i in ips %} {{ i.player.username }} - {{ i.last_used }} + {{ i.last_used_formatted }} {% endfor %} diff --git a/templates/minecraft_manager/player_info.html b/templates/minecraft_manager/player_info.html index ed33468..653eeec 100644 --- a/templates/minecraft_manager/player_info.html +++ b/templates/minecraft_manager/player_info.html @@ -59,7 +59,7 @@ {% for ip in form.ips %} - {{ ip.ip }} ({{ ip.last_used }}) + {{ ip.ip }} ({{ ip.last_used_formatted }}) {% if ip.associated %} {% for assoc in ip.associated %}