diff --git a/sapl/utils.py b/sapl/utils.py index 486bcb907..6a1c1167b 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -60,7 +60,7 @@ def num_materias_por_tipo(qs, attr_tipo='tipo'): # na key do groupby (uma alternativa é só usar tipo_id, na chave). if attr_tipo == 'tipo': - sort_function = lambda m: m.tipo + def sort_function(m): return m.tipo else: sort_function = lambda m: m.materia.tipo @@ -1061,4 +1061,4 @@ class OverwriteStorage(FileSystemStorage): def get_available_name(self, name, max_length=None): if self.exists(name): os.remove(os.path.join(settings.MEDIA_ROOT, name)) - return name \ No newline at end of file + return name