From a4b6f7e7da2c476cfde961dda06c2c3275070c51 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Thu, 23 May 2024 13:32:51 -0700 Subject: [PATCH] Call observe directly --- oauthenticator/oauth2.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/oauthenticator/oauth2.py b/oauthenticator/oauth2.py index bc3fae33..5618c9b1 100644 --- a/oauthenticator/oauth2.py +++ b/oauthenticator/oauth2.py @@ -31,6 +31,7 @@ Unicode, Union, default, + observe, validate, ) @@ -365,7 +366,7 @@ class OAuthenticator(Authenticator): """, ) - # @observe calls are set in __init__ + @observe("allowed_groups", "admin_groups", "auth_state_groups_key") def _requires_manage_groups(self, change): """ Validate that group management keys are only set when manage_groups is also True @@ -1240,10 +1241,6 @@ def __init__(self, **kwargs): self._deprecated_oauth_trait, names=list(self._deprecated_oauth_aliases) ) - self.observe( - self._requires_manage_groups, - names=("auth_state_groups_key", "admin_groups", "allowed_groups"), - ) super().__init__(**kwargs)