Moves log file configuration to config.py#128
Merged
Conversation
a7306c8 to
1ce6753
Compare
Member
|
@thatarchguy, I added some code to verify that the log file is set and writable prior to allowing you to enable auditing. If you're good with the change. Let's squash the commits. |
Member
|
Actually, we should probably add unit tests so that we know that if the log file is not writable,and the user tries to turn on logging, that the new code raises an exception. |
Member
|
@thatarchguy, can you check my last commit? If you're good with it, I'll squash your commits and merge it. |
Member
Author
|
No need to squash commits |
Changed to not use current_app to get config.py value Updated docs and tests Signed-off-by: Kevin <kevin@stealsyour.pw>
Verifies that the log file is writable before allowing logging to be turned on Improved Unit Tests Database is recreated before every test for consistency Logging is turned off by default during tests Tests that test the functionality of logging or reading the log file now have a file created in the temporary directory handled by py.test. Tests were added to test turn on updating login auditing and turn on maildb auditing
c18c60e to
455a6e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Moving the log file configuration to the config.py is a safer choice than allowing it to be configured in the web interface and api.
In order to change the log file location:
python manage.py setlogfile <path>or edit config.py(service apache2 restart)I dislike importing
appto get the config value in the utils files. I was usingcurrent_app, but this broke the tests because it was working out of the context of the application.Fixes #107