Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix call to D3.json

Roland Geider41d15311941b
diff --git a/wger/nutrition/static/js/nutrition.js b/wger/nutrition/static/js/nutrition.js
index 90daaa17c..55acf3cc7 100644
--- a/wger/nutrition/static/js/nutrition.js
+++ b/wger/nutrition/static/js/nutrition.js
@@ -179,7 +179,7 @@ function wgerRenderBodyMassIndex(w) {
.attr('width', width)
.attr('height', height);
- d3.json('/nutrition/calculator/bmi/chart-data', function (data) {
+ d3.json('/nutrition/calculator/bmi/chart-data').then(function (data) {
var $bmiForm;
var url;
var layers;
diff --git a/wger/settings_global.py b/wger/settings_global.py
index b1fff2752..949cd20cc 100644
--- a/wger/settings_global.py
+++ b/wger/settings_global.py
@@ -96,7 +96,7 @@ INSTALLED_APPS = (
BOWER_INSTALLED_APPS = (
'bootstrap#4.x',
'components-font-awesome#5.13.x',
- 'd3',
+ 'd3#5.16.x',
'DataTables',
'devbridge-autocomplete#1.2.x',
'jquery#2.x',
diff --git a/wger/weight/static/js/weight.js b/wger/weight/static/js/weight.js
index 8351f7db0..742024d8a 100644
--- a/wger/weight/static/js/weight.js
+++ b/wger/weight/static/js/weight.js
@@ -56,7 +56,7 @@ $(document).ready(function () {
username = $('#current-username').data('currentUsername');
url = '/weight/api/get_weight_data/' + username;
- d3.json(url, function (json) {
+ d3.json(url).then(function (json) {
var data;
if (json.length) {
data = MG.convert.date(json, 'date');