edit view should be a bit faster
This commit is contained in:
@@ -2358,7 +2358,7 @@ def instroke_chart(request,id=0,metric=''):
|
|||||||
height = 600
|
height = 600
|
||||||
|
|
||||||
imgs = GraphImage.objects.filter(workout=w)
|
imgs = GraphImage.objects.filter(workout=w)
|
||||||
if len(imgs) < 7:
|
if imgs.count() < 7:
|
||||||
i = GraphImage(workout=w,
|
i = GraphImage(workout=w,
|
||||||
creationdatetime=timezone.now(),
|
creationdatetime=timezone.now(),
|
||||||
filename=fullpathimagename,
|
filename=fullpathimagename,
|
||||||
@@ -3505,17 +3505,9 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
|
|||||||
dataprep.runcpupdate(row.user,type=row.workouttype)
|
dataprep.runcpupdate(row.user,type=row.workouttype)
|
||||||
|
|
||||||
messages.info(request,successmessage)
|
messages.info(request,successmessage)
|
||||||
url = reverse('workout_edit_view',
|
else:
|
||||||
kwargs = {
|
|
||||||
'id':encoder.encode_hex(row.id),
|
|
||||||
})
|
|
||||||
response = HttpResponseRedirect(url)
|
|
||||||
|
|
||||||
#else: # form not POSTed
|
|
||||||
form = WorkoutForm(instance=row)
|
form = WorkoutForm(instance=row)
|
||||||
|
|
||||||
row = get_workout(id)
|
|
||||||
|
|
||||||
g = GraphImage.objects.filter(workout=row).order_by("-creationdatetime")
|
g = GraphImage.objects.filter(workout=row).order_by("-creationdatetime")
|
||||||
for i in g:
|
for i in g:
|
||||||
try:
|
try:
|
||||||
@@ -3706,7 +3698,7 @@ def workout_uploadimage_view(request,id):
|
|||||||
images = GraphImage.objects.filter(workout=w)
|
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"
|
message = "You have reached the maximum number of static images for this workout"
|
||||||
messages.error(request,message)
|
messages.error(request,message)
|
||||||
url = reverse(r.defaultlandingpage,
|
url = reverse(r.defaultlandingpage,
|
||||||
|
|||||||
Reference in New Issue
Block a user