Private
Public Access
1
0

fixed background jobs in tests

This commit is contained in:
Sander Roosendaal
2019-02-17 10:58:51 +01:00
parent c4523ea03e
commit 158a1e7956
3 changed files with 27 additions and 24 deletions

View File

@@ -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

View File

@@ -63,7 +63,7 @@
<thead>
<tr>
<th>Name</th>
<th>Manager</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -80,7 +80,7 @@
</tbody>
</table>
{% endif %}
<a class="button green" href="/rowers/team/create/">New Training Group</a>
<a href="/rowers/team/create/">Create New Training Group</a>
</li>
{% if coaches %}
<li class="grid_2">
@@ -223,9 +223,9 @@
{% endif %}
{% if mycoachrequests or mycoachoffers or coachoffers or coachrequests %}
<li class="grid_2">
<h2>Coaching Invitations and Requests</h2>
<p>This section lists open invites related to coaching.
By accepting a coaching invite, the coach can run
<h2>Coaching Offers and Requests</h2>
<p>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

Binary file not shown.