Skip to content

Commit

Permalink
Remove conflicting simplejson dependency; Remove raven which is incom…
Browse files Browse the repository at this point in the history
…patible with Django 1.4; Add error when graph has no data
  • Loading branch information
ejnens committed Aug 23, 2012
1 parent 962c201 commit 906878b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHANGES.rst
Expand Up @@ -5,7 +5,11 @@ Changelog of lizard-ui
4.8 (unreleased)
----------------

- Nothing changed yet.
- Remove conflicting simplejson dependency.

- Remove raven which is incompatible with Django 1.4.

- Add error when graph has no data.


4.7 (2012-08-23)
Expand Down
1 change: 0 additions & 1 deletion buildout.cfg
Expand Up @@ -25,7 +25,6 @@ eggs =
# Specific pins
lizard-ui =
django-compressor = 1.2a1
simplejson = 2.4.0

# Reported by buildout-versions
django-appconf = 0.5
Expand Down
10 changes: 8 additions & 2 deletions lizard_ui/static/lizard_ui/lizard.js
Expand Up @@ -148,14 +148,16 @@ function reloadFlotGraph($graph, max_image_width, callback) {
var plot = flotGraphLoadData($graph, max_image_width, response);
$graph.attr('data-graph-loaded', 'true');
// fix for IE8...; IE7 is fine
fixIE8DrawBug(plot);
if (plot) {
fixIE8DrawBug(plot);
}
if (callback !== undefined) {
callback();
}
},
timeout: 20000,
error: function () {
$graph.html('Failed to load the graph data.');
$graph.html('Fout bij het laden van gegevens.');
},
complete: function () {
$loading.remove();
Expand All @@ -173,6 +175,10 @@ function reloadFlotGraph($graph, max_image_width, callback) {
*/
function flotGraphLoadData($graph, max_image_width, response) {
var data = response.data;
if (data.length === 0) {
$graph.html('Geen gegevens beschikbaar.');
return;
}
var defaultOpts = {
series: {
points: { show: true, hoverable: true }
Expand Down
1 change: 0 additions & 1 deletion lizard_ui/tests.py
Expand Up @@ -4,7 +4,6 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils import simplejson as json

from lizard_ui.models import ApplicationIcon
from lizard_ui.configchecker import checker
Expand Down
3 changes: 1 addition & 2 deletions lizard_ui/testsettings.py
Expand Up @@ -15,7 +15,6 @@
'south',
'compressor',
'staticfiles',
'raven.contrib.django',
'lizard_security',
'django_extensions',
'django_nose',
Expand Down Expand Up @@ -90,4 +89,4 @@
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'

STATICFILES_FINDERS = STATICFILES_FINDERS
LOGGING = setup_logging(BUILDOUT_DIR, sentry_level='WARN')
LOGGING = setup_logging(BUILDOUT_DIR)
2 changes: 1 addition & 1 deletion lizard_ui/views.py
Expand Up @@ -3,6 +3,7 @@
import logging
import urlparse
import urllib
import json

from django.conf import settings
from django.contrib.auth import login
Expand All @@ -12,7 +13,6 @@
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.utils import simplejson as json
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateView, View
from django.views.generic.edit import FormView
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Expand Up @@ -17,8 +17,6 @@
'django-staticfiles >= 1.0',
'django_compressor >= 1.1.2', # Yes, underscore.
'pytz',
'raven',
'simplejson',
'docutils', # For the admin docs.
'lizard-security',
'south',
Expand Down

0 comments on commit 906878b

Please sign in to comment.