From bcb953132ef9d11837b91715a4dfd8a3ca60bedc Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 14 Sep 2022 22:06:09 +0200 Subject: [PATCH] test --- rowers/templates/alerts.html | 13 +++++++------ rowers/views/importviews.py | 12 ++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/rowers/templates/alerts.html b/rowers/templates/alerts.html index b6830a63..9045766f 100644 --- a/rowers/templates/alerts.html +++ b/rowers/templates/alerts.html @@ -24,14 +24,14 @@ title="Delete"> - -
- +

{{ stats|alertstatspercentage:forloop.counter }}%

@@ -89,6 +89,7 @@ var alertid = $(this).data().alertid; var thediv = $(this); url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/"; + console.log(url); $.getJSON(window.location.protocol + '//' + window.location.host + url, function(json) { var percentage = json['stats']['percentage']; @@ -109,11 +110,11 @@ if ( nperiod<0 ) { nperiod=0 }; - + var user = $(this).data().user; var alertid = $(this).data().alertid; var thediv = $(this) - url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/"; + url = "/rowers/alerts/"+alertid+"/report/"+nperiod+"/user/"+user+"/"; $.getJSON(window.location.protocol + '//' + window.location.host + url, function(json) { var percentage = json['stats']['percentage']; @@ -128,7 +129,7 @@ }); }); - }); + }); {% endblock %} diff --git a/rowers/views/importviews.py b/rowers/views/importviews.py index bd8d43d9..45b278b6 100644 --- a/rowers/views/importviews.py +++ b/rowers/views/importviews.py @@ -646,12 +646,12 @@ def workout_nkimport_view(request, userid=0, after=0, before=0): startdate = startdate.date() enddate = enddate.date() r = getrequestrower(request, userid=userid) - if r.user != request.user: # pragma: no cover - messages.error( - request, 'You can only access your own workouts on the NK Logbook, not those of your athletes') - url = reverse('workout_nkimport_view', kwargs={ - 'userid': request.user.id}) - return HttpResponseRedirect(url) + #if r.user != request.user: # pragma: no cover + # messages.error( + # request, 'You can only access your own workouts on the NK Logbook, not those of your athletes') + # url = reverse('workout_nkimport_view', kwargs={ + # 'userid': request.user.id}) + # return HttpResponseRedirect(url) try: _ = nk_open(request.user)