Commits

Francisco Souza committed 56fd0b6

Ajuste de alguns warnings apontados pelo Pydev.

  • Participants
  • Parent commits 5802dc0

Comments (0)

Files changed (3)

File cursos/admin.py

     list_filter = ('instrutor',)
 
 class InstrutorAdmin(ModelAdmin):
-     list_display = ('nome',)
-     search_fields = ('nome',)
+    list_display = ('nome',)
+    search_fields = ('nome',)
 
-     def save_model(self, request, obj, form, change):
-         super(InstrutorAdmin, self).save_model(request, obj, form, change)
-         if 'foto' in form.changed_data:
-             extensao = obj.foto.name.split('.')[-1]
+    def save_model(self, request, obj, form, change):
+        super(InstrutorAdmin, self).save_model(request, obj, form, change)
+        if 'foto' in form.changed_data:
+            extensao = obj.foto.name.split('.')[-1]
+            nova_foto = Image.open(obj.foto.path)
+            nova_foto.thumbnail((100, 100), Image.ANTIALIAS)
 
-             nova_foto = Image.open(obj.foto.path)
-             nova_foto.thumbnail((100, 100), Image.ANTIALIAS)
-
-             obj.foto = 'cursos/fotos_instrutores/%d.%s' % (obj.id, extensao)
-             nova_foto.save(obj.foto.path)
-             obj.save()
+            obj.foto = 'cursos/fotos_instrutores/%d.%s' % (obj.id, extensao)
+            nova_foto.save(obj.foto.path)
+            obj.save()
 
 admin.site.register(Aluno)
 admin.site.register(Instrutor, InstrutorAdmin)

File cursos/forms.py

 #coding:utf-8
 
 from django import forms
-from django.contrib.auth.forms import UserCreationForm
 from django.contrib.auth.models import User
-
-from models import Aluno, Curso
+from models import Aluno
 from util.validacoes import validar_cpf
 
 class AlunoForm(forms.ModelForm):

File settings.py

File contents unchanged.