diff --git a/core/controllers/ProfileController.py b/core/controllers/ProfileController.py index 0c46b6d..9324679 100644 --- a/core/controllers/ProfileController.py +++ b/core/controllers/ProfileController.py @@ -33,6 +33,14 @@ class ProfileController: if profile_observer is not None: profile_observer.notify('created', profile) + @staticmethod + def update(profile: Union[SessionProfile, SystemProfile], profile_observer: ProfileObserver = None): + + Profile.save(profile) + + if profile_observer is not None: + profile_observer.notify('updated', profile) + @staticmethod def enable(profile: Union[SessionProfile, SystemProfile], force: bool = False, pristine: bool = False, profile_observer: ProfileObserver = None, application_version_observer: ApplicationVersionObserver = None, connection_observer: ConnectionObserver = None): diff --git a/core/observers/ProfileObserver.py b/core/observers/ProfileObserver.py index bcfc336..8071dbf 100644 --- a/core/observers/ProfileObserver.py +++ b/core/observers/ProfileObserver.py @@ -6,6 +6,7 @@ class ProfileObserver(BaseObserver): def __init__(self): self.on_created = [] + self.on_updated = [] self.on_destroyed = [] self.on_disabled = [] self.on_enabled = []