コード例 #1
0
 def _wrapped_view_func(
     request: HttpRequest, user_profile: UserProfile, *args: object, **kwargs: object
 ) -> HttpResponse:
     if not user_profile.can_edit_user_groups():
         raise JsonableError(_("Insufficient permission"))
     return view_func(request, user_profile, *args, **kwargs)
コード例 #2
0
ファイル: test_user_groups.py プロジェクト: pastewka/zulip
 def validation_func(user_profile: UserProfile) -> bool:
     user_profile.refresh_from_db()
     return user_profile.can_edit_user_groups()