-
-
Notifications
You must be signed in to change notification settings - Fork 518
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
Ask for password before adding entry instead of after #951
Conversation
This fixes jrnl-org#799 because previously it would allow you to create an entry using your editor and then attempt to open the journal. This behaviour is fine for unencrypted journals but with encrypted journals it means that if you get the password wrong three times then the entry you just wrote is lost. Swapping the order around so that the entry is opened first in the code and then the editor is added means that this can't happen.
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.
One small typo but otherwise looks great.
jrnl/cli.py
Outdated
@@ -345,6 +345,13 @@ def run(manual_args=None): | |||
else: | |||
_exit_multiline_code = "press Ctrl+D" | |||
|
|||
# This is where we fi±nally open the journal! |
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.
This is really minor, but could please remove the typo in "finally"?
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.
💯
Thanks for making my first contribution to open source a good experience! |
Thanks for contributing! ❤️ |
Thanks for picking our project for your first contribution! |
* ask for password before adding entry (#799) This fixes #799 because previously it would allow you to create an entry using your editor and then attempt to open the journal. This behaviour is fine for unencrypted journals but with encrypted journals it means that if you get the password wrong three times then the entry you just wrote is lost. Swapping the order around so that the entry is opened first in the code and then the editor is added means that this can't happen.
This hopefully fixes #799 because prviously it would allow you to create an entry using your editor and then attempt to open the journal. This behaviour is fine for unecrypted journals but with encrypted journals it means that if you get the password wrong three times then the entry you wrote is lost.
Swapping the code around so that it attempts to open the journal before it opens an editor means that this can't happen. This should solve #270, #256 and #284 too.
It appears that this was the behaviour in earlier versions of
jrnl
but I'm assuming that this got lost after a rewrite.This is my first time contributing to open source so I apologise if I've formatted anything wrong or made a big mistake but I'm not really sure what the process is yet and would be happy to fix anything that I did incorrectly.
Checklist
poetry run behave
black (consistent code styling). --
poetry run black --check . --verbose --diff
(logically errors and unused imports). --
poetry run pyflakes jrnl features
Pull Requests for the same update/change?
us to include them?