Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid "File name too long" error (#1128)
* Avoid "File name too long" error Any file error will be ignored and jump straight to treating var as CSS text. fixes #1127 * Add docstring and update import order * Add unit test * Remove trailing whitespace * Log a warning if var looks like a filename but can't load The login page calls load_custom_css() twice with an empty var, so this now returns early for that. * Update code style test load_custom_css() now returns an empty string for a file that does not exist, so test_get_css_is_code() has been updated to test CSS code. * Apply black formatting * Remove unnecessary pass statement Co-authored-by: Nathan Swain <swainn@users.noreply.github.com> * Add comment for is_file Co-authored-by: Nathan Swain <swainn@users.noreply.github.com> * Add comment about long CSS string causing OSError Co-authored-by: Nathan Swain <swainn@users.noreply.github.com> * Add comment about determining if it is a CSS string Co-authored-by: Nathan Swain <swainn@users.noreply.github.com> * Apply black/flake8 formatting --------- Co-authored-by: Nathan Swain <swainn@users.noreply.github.com>
- Loading branch information