From 158a1e795662065f8b20797725b73dab54bf51db Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 17 Feb 2019 10:58:51 +0100 Subject: [PATCH] fixed background jobs in tests --- rowers/dataprep.py | 41 ++++++++++++++------------ rowers/templates/teams.html | 10 +++---- rowers/tests/testdata/testdata.csv.gz | Bin 12525 -> 12525 bytes 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index b5cb5603..066a4579 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -692,10 +692,12 @@ def runcpupdate( theids = [w.id for w in theworkouts] - if settings.DEBUG: - job = handle_updatecp.delay(rower.id,theids,debug=True,table=table) - else: - job = queue.enqueue(handle_updatecp,rower.id,theids,table=table) + job = myqueue( + queue, + handle_updatecp, + rower.id, + theids, + table=table) return job @@ -704,10 +706,11 @@ def fetchcperg(rower,theworkouts): thefilenames = [w.csvfilename for w in theworkouts] cpdf = getcpdata_sql(rower.id,table='ergcpdata') - if settings.DEBUG: - res = handle_updateergcp.delay(rower.id,thefilenames,debug=True) - else: - res = queue.enqueue(handle_updateergcp,rower.id,thefilenames) + job = myqueue( + queue, + handle_updateergcp, + rower.id, + thefilenames) return cpdf @@ -738,10 +741,12 @@ def fetchcp(rower,theworkouts,table='cpdata'): if not cpdf.empty: return cpdf['delta'],cpdf['cp'],avgpower2 else: - if settings.DEBUG: - res = handle_updatecp.delay(rower.id,theids,debug=True,table=table) - else: - res = queue.enqueue(handle_updatecp,rower.id,theids,table=table) + job = myqueue(queue, + handle_updatecp, + rower.id, + theids, + table=table) + return [],[],avgpower2 @@ -1315,13 +1320,11 @@ def new_workout_from_file(r, f2, message = "We couldn't recognize the file type" f4 = f2[:-5]+'a'+f2[-5:] copyfile(f2,f4) - if settings.DEBUG: - res = handle_sendemail_unrecognized.delay(f4, - r.user.email) - - else: - res = queuehigh.enqueue(handle_sendemail_unrecognized, - f4, r.user.email) + job = myqueue(queuehigh, + handle_sendemail_unrecognized, + f4, + r.user.email) + return (0, message, f2) # handle non-Painsled by converting it to painsled compatible CSV diff --git a/rowers/templates/teams.html b/rowers/templates/teams.html index dfa4c8fa..22e6ef47 100644 --- a/rowers/templates/teams.html +++ b/rowers/templates/teams.html @@ -63,7 +63,7 @@ Name - Manager +   @@ -80,7 +80,7 @@ {% endif %} - New Training Group + Create New Training Group {% if coaches %}
  • @@ -223,9 +223,9 @@ {% endif %} {% if mycoachrequests or mycoachoffers or coachoffers or coachrequests %}
  • -

    Coaching Invitations and Requests

    -

    This section lists open invites related to coaching. - By accepting a coaching invite, the coach can run +

    Coaching Offers and Requests

    +

    This section lists open offers and requests related to coaching. + By accepting a coaching offer, the coach can run analysis, add workouts and edit settings on behalf of the athlete. You agree to the sharing of personal data between athletes and coaches according to diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz index 849a95e6eb515d9d8ff8ae03a64c2b58ad633c9e..ce0b4dd78ecdd2dd12ad16a99b77568039f6de05 100644 GIT binary patch delta 16 XcmaEx_%@MUzMF%?#UOJd`!fRoH}3`s delta 16 XcmaEx_%@MUzMF%iEh=Lp`!fRoI