This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch avatar_url in repository https://gitbox.apache.org/repos/asf/superset.git
commit f43b92c884ebdd925825f2052a7e6f527cc49b24 Author: Maxime Beauchemin <[email protected]> AuthorDate: Mon Apr 1 21:52:43 2024 -0700 minor tweaks --- superset-frontend/src/components/FacePile/index.tsx | 1 - superset/models/user.py | 21 --------------------- superset/security/manager.py | 1 - superset/utils/slack.py | 17 +++++++++++++++++ superset/views/users/api.py | 4 +--- 5 files changed, 18 insertions(+), 26 deletions(-) diff --git a/superset-frontend/src/components/FacePile/index.tsx b/superset-frontend/src/components/FacePile/index.tsx index 77795113e3..27dee0d348 100644 --- a/superset-frontend/src/components/FacePile/index.tsx +++ b/superset-frontend/src/components/FacePile/index.tsx @@ -76,7 +76,6 @@ export default function FacePile({ users, maxCount = 4 }: FacePileProps) { </StyledAvatar> </Tooltip> ); - return <img src={avatarUrl} />; })} </StyledGroup> ); diff --git a/superset/models/user.py b/superset/models/user.py deleted file mode 100644 index 0ea5d1a332..0000000000 --- a/superset/models/user.py +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -from flask_appbuilder.security.sqla.models import User as FABUser - - -class User(FABUser): - pass diff --git a/superset/security/manager.py b/superset/security/manager.py index 4ac773bb77..e5a32e97a7 100644 --- a/superset/security/manager.py +++ b/superset/security/manager.py @@ -200,7 +200,6 @@ def query_context_modified(query_context: "QueryContext") -> bool: class SupersetSecurityManager( # pylint: disable=too-many-public-methods SecurityManager ): - user_model = User userstatschartview = None READ_ONLY_MODEL_VIEWS = {"Database", "DynamicPlugin"} diff --git a/superset/utils/slack.py b/superset/utils/slack.py index bf07653a40..93eefe4b87 100644 --- a/superset/utils/slack.py +++ b/superset/utils/slack.py @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + from flask import current_app from slack_sdk import WebClient diff --git a/superset/views/users/api.py b/superset/views/users/api.py index f26d78757c..d3aa29d595 100644 --- a/superset/views/users/api.py +++ b/superset/views/users/api.py @@ -154,9 +154,7 @@ class UserRestApi(BaseSupersetApi): ) # Saving the avatar url to the database - user_attrs = UserAttribute() - user_attrs.user_id = user_id - user_attrs.avatar_url = avatar_url + user_attrs = UserAttribute(user_id=user_id, avatar_url=avatar_url) db.session.add(user_attrs) db.session.commit() elif user_attrs:
