##// END OF EJS Templates
Add all stickers to the post instead of the last one
neko259 -
r1917:ccc50ac5 default
parent child Browse files
Show More
@@ -207,7 +207,6 b' class PostForm(NeboardForm):'
207
207
208 session = None
208 session = None
209 need_to_ban = False
209 need_to_ban = False
210 image = None
211
210
212 def clean_title(self):
211 def clean_title(self):
213 title = self.cleaned_data['title']
212 title = self.cleaned_data['title']
@@ -299,10 +298,7 b' class PostForm(NeboardForm):'
299 return title
298 return title
300
299
301 def get_images(self):
300 def get_images(self):
302 if self.image:
301 return self.cleaned_data.get('stickers', [])
303 return [self.image]
304 else:
305 return []
306
302
307 def is_subscribe(self):
303 def is_subscribe(self):
308 return self.cleaned_data['subscribe']
304 return self.cleaned_data['subscribe']
@@ -363,10 +359,12 b' class PostForm(NeboardForm):'
363 return url
359 return url
364
360
365 try:
361 try:
366 file = get_image_by_alias(url, self.session)
362 image = get_image_by_alias(url, self.session)
367 self.image = file
363 if 'stickers' not in self.cleaned_data:
364 self.cleaned_data['stickers'] = []
365 self.cleaned_data['stickers'].append(image)
368
366
369 if file is not None:
367 if image is not None:
370 return
368 return
371
369
372 if file is None:
370 if file is None:
General Comments 0
You need to be logged in to leave comments. Login now