-
Notifications
You must be signed in to change notification settings - Fork 11
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
organisations: favicon and platform name #768
Conversation
78e2a6f
to
2b693ef
Compare
217d9be
to
35086dd
Compare
sonar/config.py
Outdated
@@ -58,6 +58,9 @@ def _(x): | |||
return x | |||
|
|||
|
|||
# Sonar global view name | |||
SONAR_GLOBAL_VIEW_NAME = 'global' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using SONAR_APP_DEFAULT_ORGANISATION
?
sonar/ext.py
Outdated
@app.template_filter() | ||
def organisation_view(pid): | ||
"""Get current organisation.""" | ||
return OrganisationRecord.get_or_create(pid) if pid else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks not safe. It can in some case create a new organisation, no?
sonar/ext.py
Outdated
lambda d: d['mimetype'] == 'image/x-icon', files)) | ||
if favicon: | ||
file = favicon[0]['key'] | ||
return f'/organisations/{key}/files/{file}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use url_for
.
sonar/ext.py
Outdated
key = org.get('pid') | ||
files = org.get('_files', []) | ||
favicon = list(filter( | ||
lambda d: d['mimetype'] == 'image/x-icon', files)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be better to introduce a new type of file: favicon
cd31206
to
3214bff
Compare
|
c4071ea
to
31ac72b
Compare
31ac72b
to
9028bcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nickel 👌
* Adds the display of the custom favicon for current organisation. * Adds the organization's platform name to the browser tab. * Closes rero#705. Co-Authored-by: Bertrand Zuchuat <[email protected]>
9028bcc
to
270bc3b
Compare
Co-Authored-by: Bertrand Zuchuat [email protected]
How to test
Code review check list