fix duplicate case
This commit is contained in:
@@ -1104,7 +1104,8 @@ def workout_goldmedalstandard(workout):
|
|||||||
|
|
||||||
def check_marker(workout):
|
def check_marker(workout):
|
||||||
r = workout.user
|
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,
|
date__lte=workout.date,
|
||||||
user=r,duplicate=False,
|
user=r,duplicate=False,
|
||||||
).order_by("date")
|
).order_by("date")
|
||||||
@@ -1520,6 +1521,7 @@ def checkbreakthrough(w, r):
|
|||||||
|
|
||||||
# submit email task to send email about breakthrough workout
|
# submit email task to send email about breakthrough workout
|
||||||
if isbreakthrough:
|
if isbreakthrough:
|
||||||
|
if not w.duplicate:
|
||||||
w.rankingpiece = True
|
w.rankingpiece = True
|
||||||
w.save()
|
w.save()
|
||||||
if r.getemailnotifications and not r.emailbounced:
|
if r.getemailnotifications and not r.emailbounced:
|
||||||
@@ -1532,6 +1534,7 @@ def checkbreakthrough(w, r):
|
|||||||
|
|
||||||
# submit email task to send email about breakthrough workout
|
# submit email task to send email about breakthrough workout
|
||||||
if ishard:
|
if ishard:
|
||||||
|
if not w.duplicate:
|
||||||
w.rankingpiece = True
|
w.rankingpiece = True
|
||||||
w.save()
|
w.save()
|
||||||
if r.getemailnotifications and not r.emailbounced:
|
if r.getemailnotifications and not r.emailbounced:
|
||||||
|
|||||||
Reference in New Issue
Block a user