Private
Public Access
1
0

further pepping

This commit is contained in:
Sander Roosendaal
2022-02-15 16:53:38 +01:00
parent fb98877b5f
commit 2fb011e876
4 changed files with 81 additions and 61 deletions

View File

@@ -144,8 +144,8 @@ def rower_calcdps_view(request):
r = getrower(request.user)
ws = [(w.id, w.csvfilename) for w in Workout.objects.filter(user=r)]
res = myqueue(queue, handle_updatedps, r.user.email, ws, debug=False,
emailbounced=r.emailbounced)
_ = myqueue(queue, handle_updatedps, r.user.email, ws, debug=False,
emailbounced=r.emailbounced)
messages.info(
request, "Your workouts are being updated in the background. You will receive email when this is done.")
@@ -295,9 +295,7 @@ def invitation_revoke_view(request, id):
res, text = teams.revoke_invite(request.user, id)
if res:
messages.info(request, text)
successmessage = text
else: # pragma: no cover
message = text
messages.error(request, text)
url = reverse(rower_teams_view)
@@ -358,7 +356,8 @@ def athlete_drop_coach_confirm_view(request, id):
return render(request, 'dropcoachconfirm.html',
{
'rower': r,
'coach': coach
'coach': coach,
'breadcrumbs': breadcrumbs,
})
@@ -386,7 +385,8 @@ def coach_drop_athlete_confirm_view(request, id):
return render(request, 'dropathleteconfirm.html',
{
'rower': r,
'athlete': rower
'athlete': rower,
'breadcrumbs': breadcrumbs,
})
@@ -448,7 +448,8 @@ def team_requestmembership_view(request, teamid, userid):
# if t.manager.rower.rowerplan in ['plan','pro'] and r.rowerplan == 'basic':
if not can_join_team(r.user, t):
messages.error(request,
"You have to be on a paid plan (Pro or higher) to join this team. As a basic user you can only join teams managed by users on the Coach plan.")
"You have to be on a paid plan (Pro or higher) to join this team."
" As a basic user you can only join teams managed by users on the Coach plan.")
url = reverse('paidplans_view')
return HttpResponseRedirect(url)
@@ -468,8 +469,6 @@ def team_requestmembership_view(request, teamid, userid):
@login_required()
def request_coaching_view(request, coachid):
r = getrequestrower(request)
coach = User.objects.get(id=coachid).rower
if 'coach' in coach.rowerplan:
@@ -715,6 +714,7 @@ def team_create_view(request):
'memberteams': memberteams,
'otherteams': otherteams,
'active': 'nav-teams',
'rower': r,
'breadcrumbs': breadcrumbs,
})
@@ -749,6 +749,8 @@ def team_deleteconfirm_view(request, team_id):
'myteams': myteams,
'memberteams': memberteams,
'otherteams': otherteams,
'rower': r,
'breadcrumbs': breadcrumbs,
'active': 'nav-teams',
})
@@ -756,7 +758,6 @@ def team_deleteconfirm_view(request, team_id):
@login_required()
@permission_required('teams.delete_team', fn=get_team_by_pk, raise_exception=True)
def team_delete_view(request, team_id):
r = getrower(request.user)
t = get_object_or_404(Team, pk=team_id)
teams.remove_team(t.id)
@@ -803,6 +804,7 @@ def team_members_stats_view(request, team_id):
'active': 'nav-teams',
'breadcrumbs': breadcrumbs,
'team': t,
'rower': r,
'theusers': theusers,
})