fixed background jobs in tests
This commit is contained in:
@@ -692,10 +692,12 @@ def runcpupdate(
|
|||||||
|
|
||||||
theids = [w.id for w in theworkouts]
|
theids = [w.id for w in theworkouts]
|
||||||
|
|
||||||
if settings.DEBUG:
|
job = myqueue(
|
||||||
job = handle_updatecp.delay(rower.id,theids,debug=True,table=table)
|
queue,
|
||||||
else:
|
handle_updatecp,
|
||||||
job = queue.enqueue(handle_updatecp,rower.id,theids,table=table)
|
rower.id,
|
||||||
|
theids,
|
||||||
|
table=table)
|
||||||
|
|
||||||
return job
|
return job
|
||||||
|
|
||||||
@@ -704,10 +706,11 @@ def fetchcperg(rower,theworkouts):
|
|||||||
thefilenames = [w.csvfilename for w in theworkouts]
|
thefilenames = [w.csvfilename for w in theworkouts]
|
||||||
cpdf = getcpdata_sql(rower.id,table='ergcpdata')
|
cpdf = getcpdata_sql(rower.id,table='ergcpdata')
|
||||||
|
|
||||||
if settings.DEBUG:
|
job = myqueue(
|
||||||
res = handle_updateergcp.delay(rower.id,thefilenames,debug=True)
|
queue,
|
||||||
else:
|
handle_updateergcp,
|
||||||
res = queue.enqueue(handle_updateergcp,rower.id,thefilenames)
|
rower.id,
|
||||||
|
thefilenames)
|
||||||
|
|
||||||
return cpdf
|
return cpdf
|
||||||
|
|
||||||
@@ -738,10 +741,12 @@ def fetchcp(rower,theworkouts,table='cpdata'):
|
|||||||
if not cpdf.empty:
|
if not cpdf.empty:
|
||||||
return cpdf['delta'],cpdf['cp'],avgpower2
|
return cpdf['delta'],cpdf['cp'],avgpower2
|
||||||
else:
|
else:
|
||||||
if settings.DEBUG:
|
job = myqueue(queue,
|
||||||
res = handle_updatecp.delay(rower.id,theids,debug=True,table=table)
|
handle_updatecp,
|
||||||
else:
|
rower.id,
|
||||||
res = queue.enqueue(handle_updatecp,rower.id,theids,table=table)
|
theids,
|
||||||
|
table=table)
|
||||||
|
|
||||||
return [],[],avgpower2
|
return [],[],avgpower2
|
||||||
|
|
||||||
|
|
||||||
@@ -1315,13 +1320,11 @@ def new_workout_from_file(r, f2,
|
|||||||
message = "We couldn't recognize the file type"
|
message = "We couldn't recognize the file type"
|
||||||
f4 = f2[:-5]+'a'+f2[-5:]
|
f4 = f2[:-5]+'a'+f2[-5:]
|
||||||
copyfile(f2,f4)
|
copyfile(f2,f4)
|
||||||
if settings.DEBUG:
|
job = myqueue(queuehigh,
|
||||||
res = handle_sendemail_unrecognized.delay(f4,
|
handle_sendemail_unrecognized,
|
||||||
|
f4,
|
||||||
r.user.email)
|
r.user.email)
|
||||||
|
|
||||||
else:
|
|
||||||
res = queuehigh.enqueue(handle_sendemail_unrecognized,
|
|
||||||
f4, r.user.email)
|
|
||||||
return (0, message, f2)
|
return (0, message, f2)
|
||||||
|
|
||||||
# handle non-Painsled by converting it to painsled compatible CSV
|
# handle non-Painsled by converting it to painsled compatible CSV
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Manager</th>
|
<th> </th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a class="button green" href="/rowers/team/create/">New Training Group</a>
|
<a href="/rowers/team/create/">Create New Training Group</a>
|
||||||
</li>
|
</li>
|
||||||
{% if coaches %}
|
{% if coaches %}
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
@@ -223,9 +223,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if mycoachrequests or mycoachoffers or coachoffers or coachrequests %}
|
{% if mycoachrequests or mycoachoffers or coachoffers or coachrequests %}
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
<h2>Coaching Invitations and Requests</h2>
|
<h2>Coaching Offers and Requests</h2>
|
||||||
<p>This section lists open invites related to coaching.
|
<p>This section lists open offers and requests related to coaching.
|
||||||
By accepting a coaching invite, the coach can run
|
By accepting a coaching offer, the coach can run
|
||||||
analysis, add workouts and edit settings on behalf of the athlete.
|
analysis, add workouts and edit settings on behalf of the athlete.
|
||||||
You agree to the sharing
|
You agree to the sharing
|
||||||
of personal data between athletes and coaches according to
|
of personal data between athletes and coaches according to
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user