Merge branch 'develop' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into develop

This commit is contained in:
Tomas "Jethro" Pokorny 2021-11-29 23:55:40 +01:00
commit 9f4be74e7e
2 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import tempfile
import logging import logging
from django.contrib.sites.shortcuts import get_current_site from django.contrib.sites.shortcuts import get_current_site
from django.core.files.storage import FileSystemStorage
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
from django.conf import settings from django.conf import settings

View file

@ -309,6 +309,15 @@ def podproblemy_v_cislu(cislo, problemy=None, hlavni_problemy=None):
else: else:
podproblemy[-1].append(problem) podproblemy[-1].append(problem)
for podproblem in podproblemy.keys():
def int_or_zero(p):
try:
return int(p.kod)
except ValueError:
return 0
podproblemy[podproblem] = sorted(podproblemy[podproblem], key=int_or_zero)
return podproblemy return podproblemy
class TypDeadline(Enum): class TypDeadline(Enum):