|  | @ -161,6 +161,19 @@ class ComissaoForm(forms.ModelForm): | 
			
		
	
		
		
			
				
					|  |  |         model = Comissao |  |  |         model = Comissao | 
			
		
	
		
		
			
				
					|  |  |         fields = '__all__' |  |  |         fields = '__all__' | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     def __init__(self, user=None, **kwargs): | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         super(ComissaoForm, self).__init__(**kwargs) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         inst = self.instance | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         if inst.pk: | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             if inst.tipo.natureza == 'P': | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 self.fields['apelido_temp'].widget.attrs['disabled'] = 'disabled' | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 self.fields['data_instalacao_temp'].widget.attrs['disabled'] = 'disabled' | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 self.fields['data_final_prevista_temp'].widget.attrs['disabled'] = 'disabled' | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 self.fields['data_prorrogada_temp'].widget.attrs['disabled'] = 'disabled' | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 self.fields['data_fim_comissao'].widget.attrs['disabled'] = 'disabled' | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     def clean(self): |  |  |     def clean(self): | 
			
		
	
		
		
			
				
					|  |  |         super(ComissaoForm, self).clean() |  |  |         super(ComissaoForm, self).clean() | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | @ -176,18 +189,23 @@ class ComissaoForm(forms.ModelForm): | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     @transaction.atomic |  |  |     @transaction.atomic | 
			
		
	
		
		
			
				
					|  |  |     def save(self, commit=True): |  |  |     def save(self, commit=True): | 
			
		
	
		
		
			
				
					
					|  |  |         comissao = super(ComissaoForm, self).save(commit) |  |  |         inst = self.instance | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         content_type = ContentType.objects.get_for_model(Comissao) |  |  |         if not inst.pk: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         object_id = comissao.pk |  |  |             comissao = super(ComissaoForm, self).save(commit) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         tipo = TipoAutor.objects.get(descricao__icontains='Comiss') |  |  |             content_type = ContentType.objects.get_for_model(Comissao) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         nome = comissao.sigla + ' - ' + comissao.nome |  |  |             object_id = comissao.pk | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         Autor.objects.create( |  |  |             tipo = TipoAutor.objects.get(descricao__icontains='Comiss') | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             content_type=content_type, |  |  |             nome = comissao.sigla + ' - ' + comissao.nome | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             object_id=object_id, |  |  |             Autor.objects.create( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             tipo=tipo, |  |  |                 content_type=content_type, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             nome=nome |  |  |                 object_id=object_id, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         ) |  |  |                 tipo=tipo, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         return comissao |  |  |                 nome=nome | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |             ) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             return comissao | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         else: | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             comissao = super(ComissaoForm, self).save(commit) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             return comissao | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | class ReuniaoForm(ModelForm): |  |  | class ReuniaoForm(ModelForm): | 
			
		
	
	
		
		
			
				
					|  | 
 |