From 617d524dc0d3d6071ea3f54362aff58453caf802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Rodrigues?= Date: Wed, 11 Mar 2020 13:44:24 -0300 Subject: [PATCH] Update sapl/utils.py Co-Authored-By: Edward <9326037+edwardoliveira@users.noreply.github.com> --- sapl/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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