sp-hydra-veil-core/core/controllers/SystemStateController.py

26 lines
527 B
Python

from core.models.system.SystemState import SystemState
class SystemStateController:
@staticmethod
def get():
return SystemState.get()
@staticmethod
def get_or_new(profile_id: int):
system_state = SystemStateController.get()
if system_state is None:
return SystemState(profile_id)
return system_state
@staticmethod
def exists():
return SystemState.exists()
@staticmethod
def update_or_create(system_state):
system_state.save()