1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-08 22:50:21 +02:00

Translate borrows

This commit is contained in:
2021-11-14 14:26:41 +01:00
parent aceb0d893c
commit d0877f5cdc
17 changed files with 213 additions and 280 deletions

View File

@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
# Copyright (C) 2017-2021 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from datetime import datetime
@ -12,11 +12,10 @@ from django.db import models
from django.db.models import Q
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from med.settings import MAX_EMPRUNT
class User(AbstractUser):
telephone = models.CharField(
phone_number = models.CharField(
verbose_name=_('phone number'),
max_length=15,
blank=True,
@ -26,12 +25,6 @@ class User(AbstractUser):
max_length=255,
blank=True,
)
maxemprunt = models.IntegerField(
verbose_name=_('maximum borrowed'),
help_text=_('Maximal amount of simultaneous borrowed item '
'authorized.'),
default=MAX_EMPRUNT,
)
comment = models.CharField(
verbose_name=_('comment'),
help_text=_('Promotion...'),
@ -39,7 +32,7 @@ class User(AbstractUser):
blank=True,
)
date_joined = models.DateTimeField(
_('date joined'),
verbose_name=_('date joined'),
default=timezone.now,
null=True,
)
@ -69,7 +62,7 @@ class User(AbstractUser):
self.email = data['email']
self.first_name = data['first_name']
self.last_name = data['last_name']
self.telephone = data['profile']['phone_number']
self.phone_number = data['profile']['phone_number']
self.address = data['profile']['address']
self.comment = data['profile']['section']