|
|
@ -668,16 +668,15 @@ class AutorForm(ModelForm): |
|
|
_('O Tipo do Autor deve ser selecionado.')) |
|
|
_('O Tipo do Autor deve ser selecionado.')) |
|
|
|
|
|
|
|
|
tipo = cd['tipo'] |
|
|
tipo = cd['tipo'] |
|
|
|
|
|
|
|
|
if 'nome' in cd and \ |
|
|
|
|
|
qs_autor.filter(nome=cd['nome']).exists(): |
|
|
|
|
|
raise ValidationError("Autor '%s' já existente!" % cd['nome']) |
|
|
|
|
|
|
|
|
|
|
|
if not tipo.content_type: |
|
|
if not tipo.content_type: |
|
|
if 'nome' not in cd or not cd['nome']: |
|
|
if 'nome' not in cd or not cd['nome']: |
|
|
self.logger.warn('Nome do Autor não informado.') |
|
|
self.logger.warn('Nome do Autor não informado.') |
|
|
raise ValidationError( |
|
|
raise ValidationError( |
|
|
_('O Nome do Autor deve ser informado.')) |
|
|
_('O Nome do Autor deve ser informado.')) |
|
|
|
|
|
|
|
|
|
|
|
if 'nome' in cd and \ |
|
|
|
|
|
qs_autor.filter(nome=cd['nome']).exists(): |
|
|
|
|
|
raise ValidationError("Autor '%s' já existente!" % cd['nome']) |
|
|
else: |
|
|
else: |
|
|
if 'autor_related' not in cd or not cd['autor_related']: |
|
|
if 'autor_related' not in cd or not cd['autor_related']: |
|
|
self.logger.warn( |
|
|
self.logger.warn( |
|
|
|