c2list checking for tombstones
This commit is contained in:
@@ -1706,6 +1706,19 @@ def workout_c2import_view(request,page=1,userid=0,message=""):
|
|||||||
knownc2ids = uniqify([
|
knownc2ids = uniqify([
|
||||||
w.uploadedtoc2 for w in Workout.objects.filter(user=r)
|
w.uploadedtoc2 for w in Workout.objects.filter(user=r)
|
||||||
])
|
])
|
||||||
|
tombstones = [
|
||||||
|
t.uploadedtoc2 for t in TombStone.objects.filter(user=r)
|
||||||
|
]
|
||||||
|
parkedids = []
|
||||||
|
try:
|
||||||
|
with open('c2blocked.json','r') as c2blocked:
|
||||||
|
jsondata = json.load(c2blocked)
|
||||||
|
parkedids = jsondata['ids']
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
knownc2ids = uniqify(knownc2ids+tombstones+parkedids)
|
||||||
|
|
||||||
newids = [c2id for c2id in c2ids if not c2id in knownc2ids]
|
newids = [c2id for c2id in c2ids if not c2id in knownc2ids]
|
||||||
for item in res.json()['data']:
|
for item in res.json()['data']:
|
||||||
d = item['distance']
|
d = item['distance']
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ from rowers.models import (
|
|||||||
PlannedSessionComment,CoachRequest,CoachOffer,
|
PlannedSessionComment,CoachRequest,CoachOffer,
|
||||||
VideoAnalysis,ShareKey,
|
VideoAnalysis,ShareKey,
|
||||||
StandardCollection,CourseStandard,
|
StandardCollection,CourseStandard,
|
||||||
VirtualRaceFollower,
|
VirtualRaceFollower,TombStone
|
||||||
)
|
)
|
||||||
from rowers.models import (
|
from rowers.models import (
|
||||||
RowerPowerForm,RowerHRZonesForm,RowerForm,RowerCPForm,GraphImage,AdvancedWorkoutForm,
|
RowerPowerForm,RowerHRZonesForm,RowerForm,RowerCPForm,GraphImage,AdvancedWorkoutForm,
|
||||||
|
|||||||
Reference in New Issue
Block a user