diff --git a/musician/__init__.py b/musician/__init__.py index 4d761dc..d97a598 100644 --- a/musician/__init__.py +++ b/musician/__init__.py @@ -2,7 +2,7 @@ Package metadata definition. """ -VERSION = (0, 1, 0, 'beta', 1) +VERSION = (0, 1, 0, 'beta', 2) def get_version(): diff --git a/musician/models.py b/musician/models.py index db3367b..2f43e28 100644 --- a/musician/models.py +++ b/musician/models.py @@ -1,6 +1,7 @@ import ast import logging +from django.utils.dateparse import parse_datetime from django.utils.html import format_html from django.utils.translation import gettext_lazy as _ @@ -100,6 +101,7 @@ class UserAccount(OrchestraModel): 'short_name': None, 'full_name': None, 'billing': {}, + 'last_login': None, } @classmethod @@ -108,7 +110,10 @@ class UserAccount(OrchestraModel): if 'billcontact' in data: billing = BillingContact.new_from_json(data['billcontact']) - return super().new_from_json(data=data, billing=billing) + + if 'last_login' in data: + last_login = parse_datetime(data['last_login']) + return super().new_from_json(data=data, billing=billing, last_login=last_login) class DatabaseUser(OrchestraModel): @@ -229,6 +234,7 @@ class MailinglistService(OrchestraModel): fields = ('name', 'status', 'address_name', 'admin_email', 'configure') param_defaults = { 'name': None, + 'is_active': True, 'admin_email': None, } @@ -236,11 +242,6 @@ class MailinglistService(OrchestraModel): self.data = kwargs super().__init__(**kwargs) - @property - def status(self): - # TODO(@slamora): where retrieve if the list is active? - return 'active' - @property def address_name(self): return "{}@{}".format(self.data['address_name'], self.data['address_domain']['name']) diff --git a/musician/templates/musician/dashboard.html b/musician/templates/musician/dashboard.html index d621e1c..375fbe3 100644 --- a/musician/templates/musician/dashboard.html +++ b/musician/templates/musician/dashboard.html @@ -4,7 +4,7 @@ {% block content %}
{% blocktrans with last_login=profile.last_login|default:"N/A" %}Last time you logged in was: {{ last_login }}{% endblocktrans %}
+{% blocktrans with last_login=profile.last_login|date:"SHORT_DATE_FORMAT" %}Last time you logged in was: {{ last_login }}{% endblocktrans %}