Korektury funguji v novem modelu.
This commit is contained in:
		
							parent
							
								
									4a359615fd
								
							
						
					
					
						commit
						085dc6ad48
					
				
					 2 changed files with 7 additions and 7 deletions
				
			
		|  | @ -155,7 +155,7 @@ class Oprava(models.Model): | ||||||
| #			setattr(self,k,v) | #			setattr(self,k,v) | ||||||
| 
 | 
 | ||||||
| 	def __str__(self): | 	def __str__(self): | ||||||
| 		return force_unicode(u'%s od %s: %s'%(self.status,self.autor,self.text)) | 		return '{} od {}: {}'.format(self.status,self.autor,self.text) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -181,7 +181,7 @@ class Komentar(models.Model): | ||||||
| 	text = models.TextField(u'text komentáře',blank = True, help_text='Text komentáře') | 	text = models.TextField(u'text komentáře',blank = True, help_text='Text komentáře') | ||||||
| 
 | 
 | ||||||
| 	def __str__(self): | 	def __str__(self): | ||||||
| 		return force_unicode(u'%s od %s: %s'%(self.cas,self.autor,self.text)) | 		return '{} od {}: {}'.format(self.cas,self.autor,self.text) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ class KorekturyView(generic.TemplateView): | ||||||
| 		# prirazeni autora podle prihlaseni | 		# prirazeni autora podle prihlaseni | ||||||
| 		autor_user = request.user | 		autor_user = request.user | ||||||
| 		# pokud existuje ucet (user), ale neni to organizator = 403 | 		# pokud existuje ucet (user), ale neni to organizator = 403 | ||||||
| 		autor = Organizator.objects.filter(user=autor_user).first() | 		autor = Organizator.objects.filter(osoba__user=autor_user).first() | ||||||
| 		if not autor: | 		if not autor: | ||||||
| 			return HttpResponseForbidden() | 			return HttpResponseForbidden() | ||||||
| 
 | 
 | ||||||
|  | @ -133,24 +133,24 @@ class KorekturyView(generic.TemplateView): | ||||||
| 		# Prijemci e-mailu | 		# Prijemci e-mailu | ||||||
| 		emails = set() | 		emails = set() | ||||||
| 		# e-mail autora korektury | 		# e-mail autora korektury | ||||||
| 		email = oprava.autor.user.email | 		email = oprava.autor.osoba.email | ||||||
| 		if email: | 		if email: | ||||||
| 			emails.add(email) | 			emails.add(email) | ||||||
| 
 | 
 | ||||||
| 		# nalezeni e-mailu na autory komentaru | 		# nalezeni e-mailu na autory komentaru | ||||||
| 		for komentar in oprava.komentar_set.all(): | 		for komentar in oprava.komentar_set.all(): | ||||||
| 			email_komentujiciho = komentar.autor.user.email | 			email_komentujiciho = komentar.autor.osoba.email | ||||||
| 			if email_komentujiciho: | 			if email_komentujiciho: | ||||||
| 				emails.add(email_komentujiciho) | 				emails.add(email_komentujiciho) | ||||||
| 
 | 
 | ||||||
| 		# zodpovedny org | 		# zodpovedny org | ||||||
| 		if oprava.pdf.org: | 		if oprava.pdf.org: | ||||||
| 			email_zobpovedny = oprava.pdf.org.user.email | 			email_zobpovedny = oprava.pdf.org.osoba.email | ||||||
| 			if email_zobpovedny: | 			if email_zobpovedny: | ||||||
| 				emails.add(email_zobpovedny) | 				emails.add(email_zobpovedny) | ||||||
| 
 | 
 | ||||||
| 		# odstran e-mail autora opravy | 		# odstran e-mail autora opravy | ||||||
| 		email = autor.user.email | 		email = autor.osoba.email | ||||||
| 		if email: | 		if email: | ||||||
| 			emails.discard(email) | 			emails.discard(email) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue