-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Library.create_new_library checks existence wrong #1155
Comments
@b4nt0 - thanks, this is a really good catch - agree that it should be tightened. Please feel free to submit a PR if you are interested to work on it - otherwise, I will try to get to it early next week. thanks! Darren |
There is also an opportunity to move some logic somewhere else, for example the following code block does not dependent on Lines 174 to 199 in 2563496
Everything it does is setting path variables, and then creating these paths and changing the access rights. |
The
create_new_library
method first checks the existence of the library, and then creates the library only if it does not exist.However, when checking existence, it uses
library_name
, while when creating it usessafe_name
. If thelibrary_name
is not equal to thesafe_name
, the next time the library existence check will not succeed, however creation of the library would also fail - because the function attempts to create a different name.The correct logic would be to convert the library name to the safe name as early as possible, and conduct further manipulations (checking existence etc.) with the safe name.
The text was updated successfully, but these errors were encountered: