##// 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 208 session = None
209 209 need_to_ban = False
210 image = None
211 210
212 211 def clean_title(self):
213 212 title = self.cleaned_data['title']
@@ -299,10 +298,7 b' class PostForm(NeboardForm):'
299 298 return title
300 299
301 300 def get_images(self):
302 if self.image:
303 return [self.image]
304 else:
305 return []
301 return self.cleaned_data.get('stickers', [])
306 302
307 303 def is_subscribe(self):
308 304 return self.cleaned_data['subscribe']
@@ -363,10 +359,12 b' class PostForm(NeboardForm):'
363 359 return url
364 360
365 361 try:
366 file = get_image_by_alias(url, self.session)
367 self.image = file
362 image = get_image_by_alias(url, self.session)
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 368 return
371 369
372 370 if file is None:
General Comments 0
You need to be logged in to leave comments. Login now