Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding links pointing to the new user profile page #1704

Merged
merged 3 commits into from
Dec 1, 2016

Conversation

mistercrunch
Copy link
Member

No description provided.

if not user:
return ''
url = '/superset/profile/{}/'.format(user.username)
return '<a href="{}">{}</a>'.format(url, escape(user) or '')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we return html here? looks like we should just be returning the url.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's for the list_columns view of the CRUD generated "Dashboards" and "Slices" page. We're tricking the list view into displaying links.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha

Copy link
Member

@bkyryliuk bkyryliuk Nov 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in flask we can put links instead of the text, DatasourceAccessRequest is implemented in similar fashion.
@mistercrunch :
s/escape(user)/escape(user.username)

@ascott
Copy link

ascott commented Nov 30, 2016

lgtm

@@ -1767,7 +1767,7 @@ def recent_activity(self, user_id):
)
.filter(
sqla.and_(
M.Log.action != 'queries',
~M.Log.action.in_(('queries', 'shortner', 'sql_json')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is ~ a type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oddly overloaded operator for NOT

}
if o.Dashboard.created_by:
user = o.Dashboard.created_by
d['creator'] = str(user)
Copy link
Member

@bkyryliuk bkyryliuk Nov 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ str(user)/'{}'.format(user.username) to be consistent and a bit more implicit

Copy link
Member Author

@mistercrunch mistercrunch Dec 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the repr of the object is good here, in some organization the username may not always be very explicit and can't be changed. For example early employees of companies get to pick their usernames/handles. We had a fair amount of those at FB.

}
if o.Slice.created_by:
user = o.Slice.created_by
d['creator'] = str(user)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@bkyryliuk
Copy link
Member

bkyryliuk commented Nov 30, 2016

LGTM once comments are resolved

@mistercrunch
Copy link
Member Author

Gonna let that one slip in as is. We can always alter it later.

@mistercrunch mistercrunch merged commit 7eef46e into apache:master Dec 1, 2016
@mistercrunch mistercrunch deleted the link_profile branch December 1, 2016 23:21
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants