Private
Public Access
1
0

strava imports now async

This commit is contained in:
Sander Roosendaal
2021-05-14 08:55:29 +02:00
parent ffa658685e
commit a92d612642
3 changed files with 6 additions and 2 deletions

View File

@@ -383,6 +383,9 @@ def async_get_workout(user,stravaid):
# Get a Strava workout summary data and stroke data by ID
def get_workout(user,stravaid,do_async=False):
if do_async:
res = async_get_workout(user,stravaid)
return {},pd.DataFrame()
try:
thetoken = strava_open(user)
except NoTokenError: # pragma: no cover

View File

@@ -34,7 +34,7 @@
{% for workout in workouts %}
<tr>
<td>
<a href="/rowers/workout/stravaimport/{{ workout|lookup:'id' }}/">Import</a></td>
<a href="/rowers/workout/stravaimport/{{ workout|lookup:'id' }}/async/">Import</a></td>
<td>{{ workout|lookup:'name' }}</td>
<td>{{ workout|lookup:'starttime' }}</td>
<td>{{ workout|lookup:'duration' }} </td>
@@ -42,7 +42,7 @@
<td>{{ workout|lookup:'type' }}</td>
<td>{{ workout|lookup:'new' }}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -2049,6 +2049,7 @@ def workout_getimportview(request,externalid,source = 'c2',do_async=False):
if do_async: # pragma: no cover
messages.info(request,"Your workout will be imported in the background")
# this should return to the respective import list page
url = reverse('workouts_view')
return HttpResponseRedirect(url)