mirror of
https://github.com/fuckpiracyshield/service.git
synced 2024-05-20 05:56:17 +02:00
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from piracyshield_service.account.create import AccountCreateService
|
|
|
|
from piracyshield_data_model.guest.model import GuestModel
|
|
|
|
from piracyshield_data_storage.guest.storage import GuestStorage
|
|
|
|
class GuestCreateService(AccountCreateService):
|
|
|
|
"""
|
|
Creates a guest account.
|
|
"""
|
|
|
|
def __init__(self):
|
|
"""
|
|
Pass the data model and data storage to the parent class.
|
|
"""
|
|
|
|
super().__init__(GuestModel, GuestStorage)
|
|
|
|
def execute(self, name: str, email: str, password: str, confirm_password: str, flags: dict, created_by: str) -> str | Exception:
|
|
"""
|
|
Account creation.
|
|
|
|
:param name: a string that identificates the real name (and, eventually, sourname) of the account.
|
|
:param email: e-mail address, used in conjunction with a password to authenticate the account.
|
|
:param password: a string.
|
|
:param confirm_password: must be the same as `password`.
|
|
:param flags: flags of the account.
|
|
:param created_by: account id of the creator.
|
|
:return account id of the created account.
|
|
"""
|
|
|
|
return super().execute(name, email, password, confirm_password, flags, created_by)
|