forked from DGNum/gestioCOF
Move choices_length
to shared folder
This commit is contained in:
parent
730611039b
commit
4da5add25a
4 changed files with 8 additions and 12 deletions
|
@ -1,6 +1,5 @@
|
|||
import re
|
||||
from datetime import date
|
||||
from functools import reduce
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.validators import RegexValidator
|
||||
|
@ -11,6 +10,7 @@ from django.utils import timezone
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from gestioncof.models import CofProfile
|
||||
from shared.utils import choices_length
|
||||
|
||||
from . import KFET_DELETED_TRIGRAMME
|
||||
from .auth import KFET_GENERIC_TRIGRAMME
|
||||
|
@ -19,10 +19,6 @@ from .config import kfet_config
|
|||
from .utils import to_ukf
|
||||
|
||||
|
||||
def choices_length(choices):
|
||||
return reduce(lambda m, choice: max(m, len(choice[0])), choices, 0)
|
||||
|
||||
|
||||
def default_promo():
|
||||
now = date.today()
|
||||
return now.month <= 8 and now.year - 1 or now.year
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue