Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixed issue with non-working unlock #155

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

czandee
Copy link
Contributor

@czandee czandee commented Sep 24, 2022

Hi

The command surepy locking -d <id> -m unlock would not work (at least in my system). Because of the if lock_state: in the CLI locking command method which always resolves to false when 0 (and 0 is the enum value of unlock).

So the only change I suggest to fix this is to remove the if lock_state: condition completely - this condition is superfluous because the assignment block above makes sure that either lock_state has a reasonable value or returns otherwise. Another possibility would be to write if lock_state in LockState: which would make (doubly) sure that lock_state has a valid value.

Best regards, Chris

@benleb benleb merged commit cf3fcf4 into benleb:dev Apr 4, 2023
@benleb
Copy link
Owner

benleb commented Apr 4, 2023

Thanks! 👍 And sorry for the slight delay 🙄 included in the 0.9.0a0 pre-release here: https://pypi.org/project/surepy/0.9.0a0/ :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants