Browse Source
Update sapl/utils.py
Co-Authored-By: Edward <9326037+edwardoliveira@users.noreply.github.com>
pull/3121/head
João Rodrigues
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
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). |
|
|
# na key do groupby (uma alternativa é só usar tipo_id, na chave). |
|
|
|
|
|
|
|
|
if attr_tipo == 'tipo': |
|
|
if attr_tipo == 'tipo': |
|
|
sort_function = lambda m: m.tipo |
|
|
def sort_function(m): return m.tipo |
|
|
else: |
|
|
else: |
|
|
sort_function = lambda m: m.materia.tipo |
|
|
sort_function = lambda m: m.materia.tipo |
|
|
|
|
|
|
|
|
@ -1061,4 +1061,4 @@ class OverwriteStorage(FileSystemStorage): |
|
|
def get_available_name(self, name, max_length=None): |
|
|
def get_available_name(self, name, max_length=None): |
|
|
if self.exists(name): |
|
|
if self.exists(name): |
|
|
os.remove(os.path.join(settings.MEDIA_ROOT, name)) |
|
|
os.remove(os.path.join(settings.MEDIA_ROOT, name)) |
|
|
return name |
|
|
return name |
|
|
|