Skip to content
Snippets Groups Projects
Commit b413145c authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Made cockpit more resilient to double entries in the mysql DB

parent a3d7950c
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ import sys
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.utils import simplejson
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.contrib import messages
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
......@@ -213,6 +213,8 @@ def pushdata(request):
mo.data = simplejson.dumps(d['metricData'])
mo.save()
debug[m] = "updated" # debug
except MultipleObjectsReturned:
debug[m] = "not updated - multiple objects found" # debug
else:
debug[m] = "not updated" # debug
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment