fix duplicate case
This commit is contained in:
@@ -1104,7 +1104,8 @@ def workout_goldmedalstandard(workout):
|
||||
|
||||
def check_marker(workout):
|
||||
r = workout.user
|
||||
ws = Workout.objects.filter(date__gte=workout.date-datetime.timedelta(days=r.kfit),
|
||||
dd = arrow.get(workout.date).datetime-datetime.timedelta(days=r.kfit)
|
||||
ws = Workout.objects.filter(date__gte=dd,
|
||||
date__lte=workout.date,
|
||||
user=r,duplicate=False,
|
||||
).order_by("date")
|
||||
@@ -1520,8 +1521,9 @@ def checkbreakthrough(w, r):
|
||||
|
||||
# submit email task to send email about breakthrough workout
|
||||
if isbreakthrough:
|
||||
w.rankingpiece = True
|
||||
w.save()
|
||||
if not w.duplicate:
|
||||
w.rankingpiece = True
|
||||
w.save()
|
||||
if r.getemailnotifications and not r.emailbounced:
|
||||
job = myqueue(queuehigh,handle_sendemail_breakthrough,
|
||||
w.id,
|
||||
@@ -1532,8 +1534,9 @@ def checkbreakthrough(w, r):
|
||||
|
||||
# submit email task to send email about breakthrough workout
|
||||
if ishard:
|
||||
w.rankingpiece = True
|
||||
w.save()
|
||||
if not w.duplicate:
|
||||
w.rankingpiece = True
|
||||
w.save()
|
||||
if r.getemailnotifications and not r.emailbounced:
|
||||
job = myqueue(queuehigh,handle_sendemail_hard,
|
||||
w.id,
|
||||
|
||||
Reference in New Issue
Block a user