We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b0b79c commit b3f2c47Copy full SHA for b3f2c47
django/gsmap/models.py
@@ -210,16 +210,19 @@ def test_exists(pk):
210
super().save(*args, **kwargs)
211
212
def image_twitter(self):
213
- return get_thumbnail(
214
- self.screenshot, '1200x630',
215
- crop='bottom', format='PNG'
216
- )
+ if bool(self.screenshot):
+ return get_thumbnail(
+ self.screenshot, '1200x630',
+ crop='bottom', format='PNG'
217
+ )
218
+ return ''
219
220
def image_facebook(self):
221
222
223
224
225
226
227
def __str__(self):
228
if self.municipality:
0 commit comments