restricted allowable static images to 6
This commit is contained in:
@@ -280,11 +280,16 @@ def make_plot(r,w,f1,f2,plottype,title,imagename='',plotnr=0):
|
||||
width = 1200
|
||||
height = 600
|
||||
|
||||
i = GraphImage(workout=w,
|
||||
creationdatetime=timezone.now(),
|
||||
filename=fullpathimagename,
|
||||
width=width,height=height)
|
||||
i.save()
|
||||
imgs = GraphImage.objects.filter(workout=w)
|
||||
if len(imgs) < 7:
|
||||
i = GraphImage(workout=w,
|
||||
creationdatetime=timezone.now(),
|
||||
filename=fullpathimagename,
|
||||
width=width,height=height)
|
||||
|
||||
i.save()
|
||||
else:
|
||||
return 0,'You have reached the maximum number of static images for this workout. Delete an image first'
|
||||
|
||||
return i.id,job.id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user