improved date behavior for cloning
This commit is contained in:
@@ -2226,11 +2226,11 @@ def workout_trimp(workout):
|
|||||||
return trimp
|
return trimp
|
||||||
|
|
||||||
def workout_rscore(w):
|
def workout_rscore(w):
|
||||||
r = workout.user
|
r = w.user
|
||||||
df,row = getrowdata_db(id=workout.id)
|
df,row = getrowdata_db(id=w.id)
|
||||||
df = clean_df_stats(df)
|
df = clean_df_stats(df)
|
||||||
if df.empty:
|
if df.empty:
|
||||||
df,row = getrowdata_db(id=workout.id)
|
df,row = getrowdata_db(id=w.id)
|
||||||
df = clean_df_stats(df,workstrokesonly=False)
|
df = clean_df_stats(df,workstrokesonly=False)
|
||||||
|
|
||||||
duration = df['time'].max()-df['time'].min()
|
duration = df['time'].max()-df['time'].min()
|
||||||
|
|||||||
@@ -11969,8 +11969,10 @@ def plannedsession_clone_view(request,id=0,rowerid=0,
|
|||||||
|
|
||||||
ps.pk = None
|
ps.pk = None
|
||||||
|
|
||||||
|
deltadays = ps.enddate-ps.startdate
|
||||||
|
|
||||||
ps.startdate = timezone.now()
|
ps.startdate = timezone.now()
|
||||||
ps.enddate = timezone.now()
|
ps.enddate = timezone.now()+deltadays
|
||||||
ps.name += ' (copy)'
|
ps.name += ' (copy)'
|
||||||
|
|
||||||
ps.save()
|
ps.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user