diff --git a/docs/changelog.rst b/docs/changelog.rst index bad46fca7..b95d75d0a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -18,6 +18,15 @@ Please make sure you have a fresh **database backup** before upgrading! Upgradin +v1.22.1 - 2018-07-22 +^^^^^^^^^^^^^^^^^^^^ + +**Tickets resolved in this release:** + +- [`#506 `_] Fasen-grafiek hangt op 'loading' + + + v1.22.0 - 2018-07-22 ^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/credits.rst b/docs/credits.rst index 42778e116..2ae10c0f8 100644 --- a/docs/credits.rst +++ b/docs/credits.rst @@ -53,6 +53,7 @@ Listed in any order, sorted by name. - `raoulteeuwen `_ - `Sander de Leeuw `_ - `Sevickson `_ +- `TampertK `_ - `ThinkPadNL `_ - `thommy101 `_ - `TopdRob `_ @@ -63,7 +64,7 @@ Listed in any order, sorted by name. - `WatskeBart `_ - `xirixiz `_ - + Software used ------------- Please note and respect their licences as well, if any. Credits to the following software and projects: diff --git a/dsmr_frontend/tests/webinterface/test_dashboard.py b/dsmr_frontend/tests/webinterface/test_dashboard.py index f3db2139c..2bb3e5764 100644 --- a/dsmr_frontend/tests/webinterface/test_dashboard.py +++ b/dsmr_frontend/tests/webinterface/test_dashboard.py @@ -257,6 +257,14 @@ def test_dashboard_xhr_electricity(self, now_mock): } ) + # Fix for bug #506. + ElectricityConsumption.objects.update(phase_currently_delivered_l1=None) + response = self.client.get( + reverse('{}:dashboard-xhr-electricity'.format(self.namespace)), + data={'delivered': True, 'returned': True, 'phases': True} + ) + self.assertEqual(response.status_code, 200, response.content) + @mock.patch('django.utils.timezone.now') def test_dashboard_xhr_gas(self, now_mock): now_mock.return_value = timezone.make_aware(timezone.datetime(2018, 7, 1)) diff --git a/dsmr_frontend/views/dashboard.py b/dsmr_frontend/views/dashboard.py index bcd982069..36caa9a00 100644 --- a/dsmr_frontend/views/dashboard.py +++ b/dsmr_frontend/views/dashboard.py @@ -117,9 +117,10 @@ def get(self, request): # noqa: C901 data['currently_returned'].append(float(current.currently_returned) * 1000) if form.cleaned_data.get('phases'): - data['phases_delivered']['l1'].append(float(current.phase_currently_delivered_l1) * 1000) - data['phases_delivered']['l2'].append(float(current.phase_currently_delivered_l2) * 1000) - data['phases_delivered']['l3'].append(float(current.phase_currently_delivered_l3) * 1000) + # 'or 0' is required due to empty data. + data['phases_delivered']['l1'].append(float(current.phase_currently_delivered_l1 or 0) * 1000) + data['phases_delivered']['l2'].append(float(current.phase_currently_delivered_l2 or 0) * 1000) + data['phases_delivered']['l3'].append(float(current.phase_currently_delivered_l3 or 0) * 1000) if form.cleaned_data.get('returned'): # 'or 0' is required due to backwards compatibility. diff --git a/dsmrreader/__init__.py b/dsmrreader/__init__.py index 6d7d59dee..9765f1c97 100644 --- a/dsmrreader/__init__.py +++ b/dsmrreader/__init__.py @@ -17,6 +17,6 @@ from django.utils.version import get_version -VERSION = (1, 22, 0, 'final', 0) +VERSION = (1, 22, 1, 'final', 0) __version__ = get_version(VERSION)