Merge branch 'develop' into feature/rules
This commit is contained in:
@@ -2301,6 +2301,35 @@ class PlannedSessionForm(ModelForm):
|
|||||||
self.fields['sessiontype'].choices = regularsessiontypechoices
|
self.fields['sessiontype'].choices = regularsessiontypechoices
|
||||||
|
|
||||||
|
|
||||||
|
class PlannedSessionTemplateForm(ModelForm):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = PlannedSession
|
||||||
|
fields = [
|
||||||
|
'name',
|
||||||
|
'sessiontype',
|
||||||
|
'sessionmode',
|
||||||
|
'criterium',
|
||||||
|
'sessionvalue',
|
||||||
|
'sessionunit',
|
||||||
|
'course',
|
||||||
|
'comment',
|
||||||
|
]
|
||||||
|
|
||||||
|
dateTimeOptions = {
|
||||||
|
'format': 'yyyy-mm-dd',
|
||||||
|
'autoclose': True,
|
||||||
|
}
|
||||||
|
|
||||||
|
widgets = {
|
||||||
|
'comment': forms.Textarea,
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self,*args,**kwargs):
|
||||||
|
super(PlannedSessionTemplateForm, self).__init__(*args, **kwargs)
|
||||||
|
self.fields['course'].queryset = GeoCourse.objects.all().order_by("country","name")
|
||||||
|
self.fields['sessiontype'].choices = regularsessiontypechoices
|
||||||
|
|
||||||
def get_course_timezone(course):
|
def get_course_timezone(course):
|
||||||
polygons = GeoPolygon.objects.filter(course = course)
|
polygons = GeoPolygon.objects.filter(course = course)
|
||||||
points = GeoPoint.objects.filter(polygon = polygons[0])
|
points = GeoPoint.objects.filter(polygon = polygons[0])
|
||||||
|
|||||||
@@ -108,6 +108,7 @@
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Value</th>
|
<th>Value</th>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
|
<th>Edit</th>
|
||||||
<th>Delete</th>
|
<th>Delete</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -125,6 +126,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td> {{ ps.sessionvalue }} </td>
|
<td> {{ ps.sessionvalue }} </td>
|
||||||
<td> {{ ps.sessionunit }} </td>
|
<td> {{ ps.sessionunit }} </td>
|
||||||
|
<td>
|
||||||
|
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/">Edit Template</a>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/">Delete</a>
|
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/">Delete</a>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -115,6 +115,7 @@
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Value</th>
|
<th>Value</th>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
|
<th>Edit</th>
|
||||||
<th>Delete</th>
|
<th>Delete</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -132,6 +133,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td> {{ ps.sessionvalue }} </td>
|
<td> {{ ps.sessionvalue }} </td>
|
||||||
<td> {{ ps.sessionunit }} </td>
|
<td> {{ ps.sessionunit }} </td>
|
||||||
|
<td>
|
||||||
|
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/">Edit Template</a>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/">Delete</a>
|
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/">Delete</a>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
197
rowers/templates/plannedsessiontemplateedit.html
Normal file
197
rowers/templates/plannedsessiontemplateedit.html
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
{% extends "newbase.html" %}
|
||||||
|
{% load staticfiles %}
|
||||||
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
{% block title %}Update Template Session{% endblock %}
|
||||||
|
|
||||||
|
{% block main %}
|
||||||
|
<h1>Edit Session Template</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<ul class="main-content">
|
||||||
|
<li class="grid_2">
|
||||||
|
<h2>{{ thesession.name }}</h2>
|
||||||
|
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||||
|
{% if form.errors %}
|
||||||
|
<p style="color: red;">
|
||||||
|
Please correct the error{{ form.errors|pluralize }} below.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
<p>
|
||||||
|
<table>
|
||||||
|
{{ form.as_table }}
|
||||||
|
</table>
|
||||||
|
</p>
|
||||||
|
{% csrf_token %}
|
||||||
|
<div id="id_guidance">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<a href="/rowers/sessions/{{ thesession.id }}/deleteconfirm">Delete</a>
|
||||||
|
</p>
|
||||||
|
<input class="button"
|
||||||
|
action="/rowers/sessions/{{ thesession.id }}/templateedit/" type="submit" value="Save">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li class="grid_2">
|
||||||
|
<h1>Templates</h1>
|
||||||
|
<p>
|
||||||
|
Click on session name to clone to current period
|
||||||
|
</p>
|
||||||
|
<table class="listtable shortpadded" width="80%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Value</th>
|
||||||
|
<th> </th>
|
||||||
|
<th>Edit</th>
|
||||||
|
<th>Delete</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for ps in sessiontemplates %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{% if ps.name != '' %}
|
||||||
|
<a class="small"
|
||||||
|
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}">{{ ps.name }}</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="small"
|
||||||
|
href="/rowers/sessions/{{ ps.id }}/clone/user/{{ rower.user.id }}/?when={{ timeperiod }}">Unnamed Session</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td> {{ ps.sessionvalue }} </td>
|
||||||
|
<td> {{ ps.sessionunit }} </td>
|
||||||
|
<td>
|
||||||
|
<a class="small" href="/rowers/sessions/{{ ps.id }}/templateedit/">Edit Template</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a class="small" href="/rowers/sessions/{{ ps.id }}/deleteconfirm/">Delete</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block sidebar %}
|
||||||
|
{% include 'menu_plan.html' %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block scripts %}
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
var o = $("td #id_sessiontype").find(":selected").val();
|
||||||
|
|
||||||
|
if (o != 'coursetest') {
|
||||||
|
$("td #id_course").hide();
|
||||||
|
$("th label[for='id_course']").hide();
|
||||||
|
} else {
|
||||||
|
$("td #id_course").show();
|
||||||
|
$("th label[for='id_course']").show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$("td #id_sessionmode").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'TRIMP') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>TRIMP has no unit</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'distance') {
|
||||||
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Distance: Set value to meters</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'time') {
|
||||||
|
$("td #id_sessionunit").prop("value","min");
|
||||||
|
$('#id_guidance').html("<p>Time: Set value to minutes</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'rScore') {
|
||||||
|
$("td #id_sessionunit").prop("value","None");
|
||||||
|
$('#id_guidance').html("<p>rScore has no unit</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("td #id_sessiontype").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'session') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Training Sessions, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'test') {
|
||||||
|
$("td #id_criterium").prop("value","exact");
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Set mode to distance. For Mandatory Tests, only distance or time are allowed.</p><p>For Mandatory Tests, the only criterium is 'Exactly'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'coursetest') {
|
||||||
|
$("th label[for='id_course']").show();
|
||||||
|
$("td #id_course").show();
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$("td #id_sessionunit").prop("value","m");
|
||||||
|
$('#id_guidance').html("<p>Set mode to distance. For OTW Tests, only distance is allowed.</p><p>The exact value is not relevant because it is calculated from the course.</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value != 'coursetest') {
|
||||||
|
$("th label[for='id_course']").hide();
|
||||||
|
$("td #id_course").hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (this.value == 'challenge') {
|
||||||
|
$("td #id_criterium").prop("value","minimum");
|
||||||
|
$('#id_guidance').html("<p>For Challenges, the default criterium is 'At Least'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.value == 'cycletarget') {
|
||||||
|
$("td #id_criterium").prop("value","none");
|
||||||
|
$('#id_guidance').html("<p>For Cycle Targets, the default criterium is 'Approximately'</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$("td #id_sessionunit").change(function() {
|
||||||
|
|
||||||
|
if (this.value == 'm') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'km') {
|
||||||
|
$("td #id_sessionmode").prop("value","distance");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to distance</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'None') {
|
||||||
|
$("td #id_sessionmode").prop("value","rScore");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to rScore</p>");
|
||||||
|
}
|
||||||
|
if (this.value == 'min') {
|
||||||
|
$("td #id_sessionmode").prop("value","time");
|
||||||
|
$('#id_guidance').html("<p>Mode was set to time</p>");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
<p>
|
<p>
|
||||||
<a href="/rowers/sessions/{{ psdict.id.1 }}/edit/user/{{ rower.user.id }}">
|
<a href="/rowers/sessions/{{ psdict.id.1 }}/edit/user/{{ rower.user.id }}">
|
||||||
Edit Session</a>
|
Edit Session</a>
|
||||||
|
/
|
||||||
|
<a href="/rowers/sessions/{{ psdict.id.1 }}/maketemplate/?next={{ request.path|urlencode }}">Save to template</a>
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h1>Session {{ psdict.name.1 }}</h1>
|
<h1>Session {{ psdict.name.1 }}</h1>
|
||||||
|
|||||||
@@ -668,6 +668,7 @@ urlpatterns = [
|
|||||||
views.plannedsession_multicreate_view,
|
views.plannedsession_multicreate_view,
|
||||||
name='plannedsession_multicreate_view'),
|
name='plannedsession_multicreate_view'),
|
||||||
re_path(r'^sessions/(?P<id>\d+)/edit/$',views.plannedsession_edit_view),
|
re_path(r'^sessions/(?P<id>\d+)/edit/$',views.plannedsession_edit_view),
|
||||||
|
re_path(r'^sessions/(?P<id>\d+)/templateedit/',views.plannedsession_templateedit_view),
|
||||||
re_path(r'^sessions/(?P<id>\d+)/maketemplate/$',views.plannedsession_totemplate_view),
|
re_path(r'^sessions/(?P<id>\d+)/maketemplate/$',views.plannedsession_totemplate_view),
|
||||||
re_path(r'^sessions/(?P<id>\d+)/compare/$',
|
re_path(r'^sessions/(?P<id>\d+)/compare/$',
|
||||||
views.plannedsession_compare_view,
|
views.plannedsession_compare_view,
|
||||||
|
|||||||
@@ -685,7 +685,9 @@ def plannedsession_teamcreate_view(request,
|
|||||||
enddatestring = enddate.strftime('%Y-%m-%d')
|
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||||
url += '?when='+startdatestring+'/'+enddatestring
|
url += '?when='+startdatestring+'/'+enddatestring
|
||||||
|
|
||||||
return HttpResponseRedirect(url)
|
next = request.GET.get('next', url)
|
||||||
|
|
||||||
|
return HttpResponseRedirect(next)
|
||||||
else:
|
else:
|
||||||
timeperiod = startdate.strftime('%Y-%m-%d')+'/'+enddate.strftime('%Y-%m-%d')
|
timeperiod = startdate.strftime('%Y-%m-%d')+'/'+enddate.strftime('%Y-%m-%d')
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
@@ -873,8 +875,8 @@ def plannedsession_teamedit_view(request,
|
|||||||
enddatestring = enddate.strftime('%Y-%m-%d')
|
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||||
url += '?when='+startdatestring+'/'+enddatestring
|
url += '?when='+startdatestring+'/'+enddatestring
|
||||||
|
|
||||||
|
next = request.GET.get('next', url)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(next)
|
||||||
else:
|
else:
|
||||||
sessioncreateform = PlannedSessionForm(instance=ps)
|
sessioncreateform = PlannedSessionForm(instance=ps)
|
||||||
sessionteamselectform = PlannedSessionTeamForm(
|
sessionteamselectform = PlannedSessionTeamForm(
|
||||||
@@ -1436,8 +1438,8 @@ def plannedsession_clone_view(request,id=0,userid=0):
|
|||||||
enddatestring = enddate.strftime('%Y-%m-%d')
|
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||||
url += '?when='+startdatestring+'/'+enddatestring
|
url += '?when='+startdatestring+'/'+enddatestring
|
||||||
|
|
||||||
|
next = request.GET.get('next', url)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(next)
|
||||||
|
|
||||||
# Clone an existing planned session
|
# Clone an existing planned session
|
||||||
# need clarity on cloning behavior time shift
|
# need clarity on cloning behavior time shift
|
||||||
@@ -1497,8 +1499,101 @@ def plannedsession_teamclone_view(request,id=0):
|
|||||||
enddatestring = enddate.strftime('%Y-%m-%d')
|
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||||
url += '?when='+startdatestring+'/'+enddatestring
|
url += '?when='+startdatestring+'/'+enddatestring
|
||||||
|
|
||||||
|
next = request.GET.get('next', url)
|
||||||
|
return HttpResponseRedirect(next)
|
||||||
|
|
||||||
|
@user_passes_test(hasplannedsessions, login_url="/rowers/paidplans/",
|
||||||
|
message="This functionality requires a Coach or Self-Coach plan",
|
||||||
|
redirect_field_name=None)
|
||||||
|
def plannedsession_templateedit_view(request,id=0):
|
||||||
|
r = getrequestrower(request)
|
||||||
|
startdate,enddate = get_dates_timeperiod(request)
|
||||||
|
try:
|
||||||
|
trainingplan = TrainingPlan.objects.filter(
|
||||||
|
startdate__lte = startdate,
|
||||||
|
rowers = r,
|
||||||
|
enddate__gte = enddate)[0]
|
||||||
|
except IndexError:
|
||||||
|
trainingplan = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
ps = PlannedSession.objects.get(id=id)
|
||||||
|
except PlannedSession.DoesNotExist:
|
||||||
|
raise Http404("Planned Session does not exist")
|
||||||
|
|
||||||
|
if ps.manager != request.user:
|
||||||
|
raise PermissionDenied("You are not allowed to edit this planned session")
|
||||||
|
|
||||||
|
if ps.sessiontype in ['race','indoorrace']:
|
||||||
|
raise PermissionDenied("You are not allowed to edit this planned session because it is a race")
|
||||||
|
|
||||||
|
if not ps.is_template:
|
||||||
|
ps.pk = None
|
||||||
|
ps.id = None
|
||||||
|
ps.is_template = True
|
||||||
|
ps.startdate = datetime.date(1970,1,1)
|
||||||
|
ps.enddate = datetime.date(1970,1,1)
|
||||||
|
ps.team.clear()
|
||||||
|
ps.save()
|
||||||
|
|
||||||
|
sessioncreateform = PlannedSessionTemplateForm(instance=ps)
|
||||||
|
|
||||||
|
if request.method == 'POST':
|
||||||
|
sessioncreateform = PlannedSessionTemplateForm(request.POST,instance=ps)
|
||||||
|
if sessioncreateform.is_valid():
|
||||||
|
cd = sessioncreateform.cleaned_data
|
||||||
|
if cd['sessionunit'] == 'min':
|
||||||
|
cd['sessionmode'] = 'time'
|
||||||
|
elif cd['sessionunit'] in ['km','m']:
|
||||||
|
cd['sessionmode'] = 'distance'
|
||||||
|
|
||||||
|
res, message = update_plannedsession(ps,cd)
|
||||||
|
|
||||||
|
if res:
|
||||||
|
messages.info(request,message)
|
||||||
|
else:
|
||||||
|
messages.error(request,message)
|
||||||
|
|
||||||
|
url = reverse(plannedsession_templateedit_view,
|
||||||
|
kwargs = {
|
||||||
|
'id':int(ps.id),
|
||||||
|
})
|
||||||
|
|
||||||
|
startdatestring = startdate.strftime('%Y-%m-%d')
|
||||||
|
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||||
|
url += '?when='+startdatestring+'/'+enddatestring
|
||||||
|
next = request.GET.get('next', url)
|
||||||
|
return HttpResponseRedirect(next)
|
||||||
|
|
||||||
|
breadcrumbs = [
|
||||||
|
{
|
||||||
|
'url': reverse(plannedsessions_view),
|
||||||
|
'name': 'Sessions'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':reverse(plannedsession_templateedit_view,
|
||||||
|
kwargs={
|
||||||
|
'id':id,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
'name': 'Edit'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
sessiontemplates = PlannedSession.objects.filter(manager=request.user,is_template=True)
|
||||||
|
|
||||||
|
return render(request,'plannedsessiontemplateedit.html',
|
||||||
|
{
|
||||||
|
'teams':get_my_teams(request.user),
|
||||||
|
'plan': trainingplan,
|
||||||
|
'breadcrumbs': breadcrumbs,
|
||||||
|
'form': sessioncreateform,
|
||||||
|
'active':'nav-plan',
|
||||||
|
'thesession': ps,
|
||||||
|
'sessiontemplates': sessiontemplates,
|
||||||
|
'rower': r,
|
||||||
|
})
|
||||||
|
|
||||||
return HttpResponseRedirect(url)
|
|
||||||
|
|
||||||
@permission_required('plannedsession.change_session',fn=get_session_by_pk,raise_exception=True)
|
@permission_required('plannedsession.change_session',fn=get_session_by_pk,raise_exception=True)
|
||||||
@user_passes_test(can_plan, login_url="/rowers/paidplans/",
|
@user_passes_test(can_plan, login_url="/rowers/paidplans/",
|
||||||
@@ -1525,7 +1620,9 @@ def plannedsession_totemplate_view(request,id=0):
|
|||||||
enddatestring = enddate.strftime('%Y-%m-%d')
|
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||||
url += '?when='+startdatestring+'/'+enddatestring
|
url += '?when='+startdatestring+'/'+enddatestring
|
||||||
|
|
||||||
return HttpResponseRedirect(url)
|
next = request.GET.get('next', url)
|
||||||
|
|
||||||
|
return HttpResponseRedirect(next)
|
||||||
|
|
||||||
# Edit an existing planned session
|
# Edit an existing planned session
|
||||||
@permission_required('plannedsession.change_session',fn=get_session_by_pk,raise_exception=True)
|
@permission_required('plannedsession.change_session',fn=get_session_by_pk,raise_exception=True)
|
||||||
@@ -1663,8 +1760,8 @@ def plannedsession_detach_view(request,id=0,psid=0):
|
|||||||
remove_workout_plannedsession(w,ps)
|
remove_workout_plannedsession(w,ps)
|
||||||
|
|
||||||
url = reverse(plannedsession_view,kwargs={'id':psid})
|
url = reverse(plannedsession_view,kwargs={'id':psid})
|
||||||
|
next = request.GET.get('next', url)
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(next)
|
||||||
|
|
||||||
@login_required()
|
@login_required()
|
||||||
@permission_required('plannedsession.view_session',fn=get_session_by_pk,raise_exception=True)
|
@permission_required('plannedsession.view_session',fn=get_session_by_pk,raise_exception=True)
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ from rowers.models import (
|
|||||||
WorkoutComment,WorkoutCommentForm,RowerExportForm,
|
WorkoutComment,WorkoutCommentForm,RowerExportForm,
|
||||||
CalcAgePerformance,
|
CalcAgePerformance,
|
||||||
PowerTimeFitnessMetric,BlogPost,
|
PowerTimeFitnessMetric,BlogPost,
|
||||||
PlannedSessionForm,
|
PlannedSessionForm,PlannedSessionTemplateForm,
|
||||||
PlannedSessionFormSmall,GeoCourseEditForm,VirtualRace,
|
PlannedSessionFormSmall,GeoCourseEditForm,VirtualRace,
|
||||||
VirtualRaceForm,VirtualRaceResultForm,RowerImportExportForm,
|
VirtualRaceForm,VirtualRaceResultForm,RowerImportExportForm,
|
||||||
IndoorVirtualRaceResultForm,IndoorVirtualRaceResult,
|
IndoorVirtualRaceResultForm,IndoorVirtualRaceResult,
|
||||||
|
|||||||
Reference in New Issue
Block a user