loadSiteInformation.py 621 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import datetime

from base_app.models import SiteInformation
from base_app.models import User
from .loadGeneric import LoadGeneric


class LoadSiteInformation(LoadGeneric):
    """
        Load currencies in the app
    """

    def __init__(self, admin: User):
        self.admin = admin

    def load(self):
        start = datetime.datetime.now()
        end = start + datetime.timedelta(days=5)
        info = SiteInformation(
            start=start,
            end=end,
            variant="success",
            message="Le site vient d'être créé !",
        )
        self.add_info_and_save(info, self.admin)