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

Remove hard-coded links to static files #1299

Merged
merged 5 commits into from
Jul 3, 2018
Merged

Remove hard-coded links to static files #1299

merged 5 commits into from
Jul 3, 2018

Conversation

c-w
Copy link
Contributor

@c-w c-w commented Jun 29, 2018

This change replaces all direct links to static files (such as
/static/foo/bar) with their equivalent url_for call. This introduces
consistency with code that creates links to the app's Flask routes and
also ensures that the links to the static files will always be correct
even if the application is for example hosted at a non-root path.

c-w and others added 2 commits June 29, 2018 08:07
This change replaces all direct links to static files (such as
`/static/foo/bar`) with their equivalent `url_for` call. This introduces
consistency with code that creates links to the app's Flask routes and
also ensures that the links to the static files will always be correct
even if the application is for example hosted at a non-root path.
colinschoen
colinschoen previously approved these changes Jul 2, 2018
Copy link
Member

@colinschoen colinschoen left a comment

Choose a reason for hiding this comment

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

LGTM

Sumukh pushed a commit that referenced this pull request Jul 2, 2018
CircleCI version `1.0` is deprecated and will be start rejecting jobs on August 30th. This PR migrates our workflow to `2.0`. This loosely follows the the [1.0 -> 2.0 Migration Guide](https://circleci.com/docs/2.0/migrating-from-1-2/).

This incidentally fixes the pip failures on recent CircleCI runs failing (#1299 #1301 etc) with the following error

`_NamespacePath object has no attribute sort `


Signed-off-by: Colin Schoen <cschoen@berkeley.edu>
@colinschoen colinschoen dismissed their stale review July 2, 2018 19:30

CI is failing.

The index routes are specific to various blueprints so we can't use
`url_for('.index')` in the error pages. Passing the application root as
a global context variable to the Flask templates works around this.
@c-w
Copy link
Contributor Author

c-w commented Jul 3, 2018

Thanks for the review @colinschoen and the CI fixes. Build now passes.

Copy link
Member

@colinschoen colinschoen left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for the quick fix!

@colinschoen colinschoen merged commit 985fe81 into okpy:master Jul 3, 2018
@c-w c-w deleted the bug/c-w/remove-direct-urls branch July 3, 2018 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants