Fix Duplikátní e-mail v editu (nebrat sebe)
This commit is contained in:
		
							parent
							
								
									9462c78fb8
								
							
						
					
					
						commit
						0bb0911830
					
				
					 2 changed files with 2 additions and 1 deletions
				
			
		|  | @ -199,7 +199,7 @@ class ProfileEditForm(forms.Form): | |||
| 		err_logger = logging.getLogger('seminar.prihlaska.problem') | ||||
| 		email = self.cleaned_data.get('email') | ||||
| 		try: | ||||
| 			Osoba.objects.get(email=email) | ||||
| 			Osoba.objects.exclude(user__username=self.username).get(email=email) | ||||
| 			msg = "Email {} exists (in edit)".format(email) | ||||
| 			err_logger.info(msg) | ||||
| 			raise forms.ValidationError('Email je již použit') | ||||
|  |  | |||
|  | @ -1162,6 +1162,7 @@ def resitelEditView(request): | |||
| 			form = PoMaturiteProfileEditForm(POST) | ||||
| 		else: | ||||
| 			form = ProfileEditForm(POST) | ||||
| 		form.username = user_edit.username | ||||
| 		if form.is_valid(): | ||||
| 			## Změny v osobě | ||||
| 			fcd = form.cleaned_data | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Jonas Havelka
						Jonas Havelka