diff --git a/zerver/decorator.py b/zerver/decorator.py index ecb97a2d83..53b523fb73 100644 --- a/zerver/decorator.py +++ b/zerver/decorator.py @@ -203,7 +203,6 @@ def validate_api_key(request, role, api_key, is_webhook=False): if api_key != profile.api_key: raise JsonableError(_("Invalid API key")) - profile = cast(UserProfile, profile) # is UserProfile if not profile.is_active: raise JsonableError(_("Account not active")) if profile.realm.deactivated: