Browse Source
			
			
			Merge pull request #1942 from interlegis/1941-verificacao-de-existencia-de-numero
			
				Fix #1941
			
			
				pull/1943/head
			
			
		 
		
			
				
					
						 Victor Fabre
					
					8 years ago
						Victor Fabre
					
					8 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 4AEE18F83AFDEB23
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
5 additions and 
4 deletions
			 
			
		 
		
			
				- 
					
					
					 
					sapl/protocoloadm/views.py
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -451,10 +451,11 @@ class ProtocoloMateriaView(PermissionRequiredMixin, CreateView): | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |         if not protocolo.numero: |  |  |         if not protocolo.numero: | 
			
		
	
		
		
			
				
					|  |  |             protocolo.numero = (numero['numero__max'] + 1) if numero['numero__max'] else 1 |  |  |             protocolo.numero = (numero['numero__max'] + 1) if numero['numero__max'] else 1 | 
			
		
	
		
		
			
				
					
					|  |  |         if protocolo.numero < (numero['numero__max'] + 1): |  |  |         if numero['numero__max']: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             msg = _('Número de protocolo deve ser maior que {}').format(numero['numero__max']) |  |  |             if protocolo.numero < (numero['numero__max'] + 1): | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             messages.add_message(self.request, messages.ERROR, msg) |  |  |                 msg = _('Número de protocolo deve ser maior que {}').format(numero['numero__max']) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             return self.render_to_response(self.get_context_data()) |  |  |                 messages.add_message(self.request, messages.ERROR, msg) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |                 return self.render_to_response(self.get_context_data()) | 
			
		
	
		
		
			
				
					|  |  |         protocolo.ano = timezone.now().year |  |  |         protocolo.ano = timezone.now().year | 
			
		
	
		
		
			
				
					|  |  |         protocolo.data = timezone.now().date() |  |  |         protocolo.data = timezone.now().date() | 
			
		
	
		
		
			
				
					|  |  |         protocolo.hora = timezone.now().time() |  |  |         protocolo.hora = timezone.now().time() | 
			
		
	
	
		
		
			
				
					|  | 
 |