Skip to content

Commit

Permalink
Call observe directly
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed May 23, 2024
1 parent 036318f commit a4b6f7e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions oauthenticator/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Unicode,
Union,
default,
observe,
validate,
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit a4b6f7e

Please sign in to comment.