Self-heal statistics results model
Happens when multiple results are created using the same slug value. Forum topic 1404. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -148,6 +148,9 @@
|
||||
- Support running specific tests inside the Docker container.
|
||||
docker run --rm mayanedms/mayanedms:3.3 run_tests
|
||||
- Make the statistics slug field unique.
|
||||
- Self-heal statistics results model when multiple
|
||||
results are created using the same slug value.
|
||||
Forum topic 1404.
|
||||
|
||||
3.2.10 (2019-XX-XX)
|
||||
===================
|
||||
|
||||
@@ -211,6 +211,7 @@ Backward incompatible changes
|
||||
Bugs fixed or issues closed
|
||||
---------------------------
|
||||
|
||||
- :forum-topic:`1404` Mayan EDMS 3.2.8 statistics error
|
||||
- :gitlab-issue:`399` Archive of processed e-mails
|
||||
- :gitlab-issue:`526` RuntimeWarning: Never call result.get() within a task!
|
||||
- :gitlab-issue:`532` Workflow preview isn't updated right after transitions are modified
|
||||
@@ -222,5 +223,4 @@ Bugs fixed or issues closed
|
||||
- :gitlab-issue:`640` UX: "Toast" Popup position prevents access to actions
|
||||
- :gitlab-issue:`644` Update sane-utils package in docker image.
|
||||
|
||||
|
||||
.. _PyPI: https://pypi.python.org/pypi/mayan-edms/
|
||||
|
||||
@@ -158,6 +158,11 @@ class Statistic(object):
|
||||
return StatisticResult.objects.get(slug=self.slug)
|
||||
except StatisticResult.DoesNotExist:
|
||||
return StatisticResult.objects.none()
|
||||
except StatisticResult.MultipleObjectsReturned:
|
||||
# This should not happen. Self-heal by deleting the duplicate
|
||||
# results.
|
||||
StatisticResult.objects.filter(slug=self.slug).delete()
|
||||
return StatisticResult.objects.none()
|
||||
|
||||
def get_results_data(self):
|
||||
results = self.get_results()
|
||||
|
||||
Reference in New Issue
Block a user