export protection
This commit is contained in:
@@ -667,8 +667,6 @@ class IntervalsIntegration(SyncIntegration):
|
||||
return 0
|
||||
|
||||
def delete_activities(self, event, *args, **kwargs):
|
||||
if not self.rower.intervals_auto_delete:
|
||||
return 0
|
||||
try:
|
||||
record = event["activity"]
|
||||
except KeyError:
|
||||
@@ -679,8 +677,11 @@ class IntervalsIntegration(SyncIntegration):
|
||||
try:
|
||||
ws = Workout.objects.filter(uploadedtointervals=id)
|
||||
for w in ws:
|
||||
if w.user == self.rower:
|
||||
if w.user == self.rower and self.rower.intervals_delete_workout:
|
||||
w.delete()
|
||||
elif w.user == self.rower:
|
||||
w.uploadedtointervals = None
|
||||
w.save()
|
||||
except Workout.DoesNotExist:
|
||||
pass
|
||||
except KeyError:
|
||||
|
||||
Reference in New Issue
Block a user