flexmeasures.data.services.accounts

Functions

flexmeasures.data.services.accounts.create_account(*, context: str | None = None, **account_data) → Account

Create an account and record its creation in the audit log.

Does not validate data or commit the session.

Parameters:
  • context – context describing how the account was created

  • account_data – keyword arguments for the new account

flexmeasures.data.services.accounts.get_account_roles(account_id: int) → list[AccountRole]
flexmeasures.data.services.accounts.get_accounts(role_name: str | None = None) → list[Account]

Return a list of Account objects. The role_name parameter allows to filter by role.

flexmeasures.data.services.accounts.get_audit_log_records(account: Account) → list[AuditLog]

Get history of account actions

flexmeasures.data.services.accounts.get_number_of_assets_in_account(account_id: int) → int

Get the number of assets in an account.