more or less done
This commit is contained in:
@@ -48,6 +48,9 @@ def analysis_new(request,
|
||||
firstworkout = get_workout(id)
|
||||
if not is_workout_team(request.user, firstworkout): # pragma: no cover
|
||||
raise PermissionDenied("You are not allowed to use this workout")
|
||||
if workout_is_strava(firstworkout):
|
||||
messages.error(request, "You cannot use Strava workouts for analysis")
|
||||
raise PermissionDenied("You cannot use Strava workouts for analysis")
|
||||
firstworkoutquery = Workout.objects.filter(id=encoder.decode_hex(id))
|
||||
|
||||
try:
|
||||
@@ -218,6 +221,7 @@ def analysis_new(request,
|
||||
)
|
||||
if firstworkout:
|
||||
workouts = firstworkoutquery | workouts
|
||||
|
||||
workouts = workouts.order_by(
|
||||
"-date", "-starttime"
|
||||
).exclude(boattype__in=negtypes)
|
||||
@@ -253,7 +257,7 @@ def analysis_new(request,
|
||||
else:
|
||||
selectedworkouts = Workout.objects.filter(id__in=ids)
|
||||
|
||||
form.fields["workouts"].queryset = workouts | selectedworkouts
|
||||
form.fields["workouts"].queryset = (workouts | selectedworkouts).exclude(workoutsource='strava')
|
||||
|
||||
optionsform = AnalysisOptionsForm(initial={
|
||||
'modality': modality,
|
||||
|
||||
Reference in New Issue
Block a user