Fix obrazek_maly_tag kdyz neni zadny obrazek.
This commit is contained in:
		
							parent
							
								
									ac7dfd002b
								
							
						
					
					
						commit
						374a97e28a
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -69,6 +69,8 @@ class Obrazek(models.Model): | ||||||
| 		ordering = ['nazev'] | 		ordering = ['nazev'] | ||||||
| 
 | 
 | ||||||
| 	def obrazek_maly_tag(self): | 	def obrazek_maly_tag(self): | ||||||
|  | 		if not self.obrazek_maly: | ||||||
|  | 			return '' | ||||||
| 		return u'<img src="{}">'.format(self.obrazek_maly.url) | 		return u'<img src="{}">'.format(self.obrazek_maly.url) | ||||||
| 	obrazek_maly_tag.short_description = "Náhled" | 	obrazek_maly_tag.short_description = "Náhled" | ||||||
| 	obrazek_maly_tag.allow_tags = True | 	obrazek_maly_tag.allow_tags = True | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue