Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have done code refactoring #160. As I mentioned in comment I did shorten some nested
if
statements and when it was possible and clean looking made them one liners. Added a specific expected errors to theexcept
blocks. In auth_backends.py I did change code accordingly because either way ifuser.check_password(password)
was successful it did returnuser
:Before:
After:
From file create.py in /backend/views/core/invoices I did delete function named
edit_invoice_page
because it was exactly the same as this function:and it have not been used anywhere in the code, so this function can be renamed to let say
create_edit_invoice_page
if would be needed for editing purposes anywhere in future.I did noticed that some functions like
edit_invoice
are repeating through out the code with some slight changes here and there which possibly could be reduced to one function and repurposed with additional arguments. If you like I could try to work on that.Hope you will be satisfied with those small changes.
Checklist
djLint-er on any new code
(checks
will
fail without)
changes
What type of PR is this?
Added/updated tests?
Related PRs, Issues etc