-
Notifications
You must be signed in to change notification settings - Fork 79
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
Move models
to its own package
#963
Conversation
Once the linked PR is done, I can submit this one: #944 |
@login_manager.user_loader | ||
def load_user(user_id): | ||
return User.query.get(int(user_id)) |
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 was moved to prevent a circular import error.
models
to its own package
BaseConfig.OO_SERVICE_EMAIL | ||
current_app.config["OO_SERVICE_EMAIL"] |
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 should address this build error: https://github.com/lucyparsons/OpenOversight/actions/runs/5488540812
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 looks good. Definitely nice how many local imports you could get rid of.
The only thing that stands out to me is the formatting of some commands. Did you run a different command? Maybe you could undo that, or take a quick look and fix the cases where moving a newline made the sentence less readable
If anything breached the 88-character limit (the one that we used in Black), I then broke it at the closest point that made sense. I can adjust those so that it doesn't produce the issues you brought up! Thanks for takin' a look and I'll take care of that now! |
@@ -62,8 +78,9 @@ def pick_birth_date(): | |||
|
|||
|
|||
def pick_date(seed: bytes = None, start_year=2000, end_year=2020): | |||
# source: https://stackoverflow.com/questions/40351791/how-to-hash-strings-into-a-float-in-01 | |||
# Wanted to deterministically create a date from a seed string (e.g. the hash or uuid on an officer object) | |||
# source: https://stackoverflow.com/q/40351791 |
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.
(HTTPStatus.FORBIDDEN, "Forbidden", "403.html"), | ||
(HTTPStatus.NOT_FOUND, "Not found", "404.html"), | ||
(HTTPStatus.REQUEST_ENTITY_TOO_LARGE, "File too large", "413.html"), | ||
(HTTPStatus.TOO_MANY_REQUESTS, "Too many requests", "429.html"), | ||
(HTTPStatus.INTERNAL_SERVER_ERROR, "Internal Server Error", "500.html"), | ||
(HTTPStatus.FORBIDDEN, HTTPStatus.FORBIDDEN.phrase, "403.html"), | ||
(HTTPStatus.NOT_FOUND, HTTPStatus.NOT_FOUND.phrase, "404.html"), | ||
( | ||
HTTPStatus.REQUEST_ENTITY_TOO_LARGE, | ||
HTTPStatus.REQUEST_ENTITY_TOO_LARGE.phrase, | ||
"413.html", | ||
), | ||
(HTTPStatus.TOO_MANY_REQUESTS, HTTPStatus.TOO_MANY_REQUESTS.phrase, "429.html"), | ||
( | ||
HTTPStatus.INTERNAL_SERVER_ERROR, | ||
HTTPStatus.INTERNAL_SERVER_ERROR.phrase, | ||
"500.html", | ||
), |
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.
lucyparsons#959 Move `models` to its own package to prevent circular dependencies and address straggling relative imports. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
lucyparsons#959 Move `models` to its own package to prevent circular dependencies and address straggling relative imports. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
lucyparsons#959 Move `models` to its own package to prevent circular dependencies and address straggling relative imports. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
lucyparsons#959 Move `models` to its own package to prevent circular dependencies and address straggling relative imports. - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
Fixes issue
#959
Description of Changes
Move
models
to its own package to prevent circular dependencies and address straggling relative imports.Tests and linting
develop
branch.pytest
passes on my local development environment.pre-commit
passes on my local development environment.