Private
Public Access
1
0

edit view should be a bit faster

This commit is contained in:
Sander Roosendaal
2019-10-31 20:58:58 +01:00
parent cd6c09e013
commit 52c2879097

View File

@@ -2358,7 +2358,7 @@ def instroke_chart(request,id=0,metric=''):
height = 600
imgs = GraphImage.objects.filter(workout=w)
if len(imgs) < 7:
if imgs.count() < 7:
i = GraphImage(workout=w,
creationdatetime=timezone.now(),
filename=fullpathimagename,
@@ -3505,16 +3505,8 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
dataprep.runcpupdate(row.user,type=row.workouttype)
messages.info(request,successmessage)
url = reverse('workout_edit_view',
kwargs = {
'id':encoder.encode_hex(row.id),
})
response = HttpResponseRedirect(url)
#else: # form not POSTed
form = WorkoutForm(instance=row)
row = get_workout(id)
else:
form = WorkoutForm(instance=row)
g = GraphImage.objects.filter(workout=row).order_by("-creationdatetime")
for i in g:
@@ -3706,7 +3698,7 @@ def workout_uploadimage_view(request,id):
images = GraphImage.objects.filter(workout=w)
if len(images) >= 6:
if images.count() >= 6:
message = "You have reached the maximum number of static images for this workout"
messages.error(request,message)
url = reverse(r.defaultlandingpage,