-
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
Restructure utils.py
to its own package
#915
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
7bc69c5
Move utils to its own package
michplunkett aa629af
Move constants to own file
michplunkett ba67866
Update references
michplunkett 28f9a1c
Update models.py
michplunkett f67e9c9
pre-check
michplunkett 03d035b
Update constants.py
michplunkett 53c9e5c
References
michplunkett abc28a8
Fixed pre-checkn
michplunkett 65a910e
Use relative paths
michplunkett f4577bc
Update Makefile
michplunkett 1c0aaec
Fix @patch string
michplunkett eb1d0df
Update forms.py
michplunkett c6d0471
Update test_utils.py
michplunkett e59db30
Use absolute path to avoid error
michplunkett 56fe1ef
Use absolute imports
michplunkett 756c2b5
Update 59e9993c169c_change_faces_to_thumbnails.py
michplunkett 7a72b0a
util -> utils
michplunkett 42e3af7
More util -> utils
michplunkett fedf57f
Comment and pathway things
michplunkett a291e91
Update general.py
michplunkett 6a90c0f
Update 59e9993c169c_change_faces_to_thumbnails.py
michplunkett b1ee101
Revert "Update 59e9993c169c_change_faces_to_thumbnails.py"
michplunkett befcfff
Update .gitignore
michplunkett 7824d7f
Update 59e9993c169c_change_faces_to_thumbnails.py
michplunkett 1ec0659
Merge branch 'develop' into util_restructure
michplunkett c7666fc
Merge branch 'develop' into util_restructure
abandoned-prototype File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,5 +85,6 @@ help: ## Print this message and exit | |
| sort \ | ||
| column -s ':' -t | ||
|
||
.PHONY: attach | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a missing |
||
attach: | ||
docker-compose exec postgres psql -h localhost -U openoversight openoversight-dev |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ | |
from werkzeug.security import check_password_hash, generate_password_hash | ||
|
||
from . import login_manager | ||
from .utils.constants import ENCODING_UTF_8 | ||
from .validators import state_validator, url_validator | ||
|
||
|
||
db = SQLAlchemy() | ||
model_encoding = "utf-8" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could remove this now that the constant isn't a circular reference. |
||
jwt = JsonWebToken("HS512") | ||
|
||
BaseModel = db.Model # type: DefaultMeta | ||
|
@@ -552,7 +552,7 @@ def verify_password(self, password): | |
|
||
def generate_confirmation_token(self, expiration=3600): | ||
payload = {"confirm": self.id} | ||
return self._jwt_encode(payload, expiration).decode(model_encoding) | ||
return self._jwt_encode(payload, expiration).decode(ENCODING_UTF_8) | ||
|
||
def confirm(self, token): | ||
try: | ||
|
@@ -572,7 +572,7 @@ def confirm(self, token): | |
|
||
def generate_reset_token(self, expiration=3600): | ||
payload = {"reset": self.id} | ||
return self._jwt_encode(payload, expiration).decode(model_encoding) | ||
return self._jwt_encode(payload, expiration).decode(ENCODING_UTF_8) | ||
|
||
def reset_password(self, token, new_password): | ||
try: | ||
|
@@ -588,7 +588,7 @@ def reset_password(self, token, new_password): | |
|
||
def generate_email_change_token(self, new_email, expiration=3600): | ||
payload = {"change_email": self.id, "new_email": new_email} | ||
return self._jwt_encode(payload, expiration).decode(model_encoding) | ||
return self._jwt_encode(payload, expiration).decode(ENCODING_UTF_8) | ||
|
||
def change_email(self, token): | ||
try: | ||
|
Oops, something went wrong.
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.
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.
I was getting this file if I opened up anything in finder on my comp.