-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor graphical updates and add datefield for backdating posts (#401)
* minor graphical updates and add datefield for backdating posts * blacken files and fix dep problem * Bump version number * date in form should be optional * oh look more formatting changes that aren't relevant to what I'm working on AT ALL Co-authored-by: itsthejoker <itsthejoker@users.noreply.github.com>
- Loading branch information
1 parent
0b1d247
commit d438478
Showing
11 changed files
with
165 additions
and
155 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ on: [pull_request] | |
|
||
jobs: | ||
build: | ||
environment: Default | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
max-parallel: 4 | ||
|
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 |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import sys | ||
from typing import Callable | ||
|
||
from better_exceptions import excepthook | ||
from django.http import HttpRequest, HttpResponse | ||
|
||
|
||
# For debug purposes only. Link to local_settings by adding | ||
# `blossom.middleware.BetterExceptionsMiddleware` | ||
# to the top of the middleware stack. | ||
class BetterExceptionsMiddleware(object): | ||
def __init__(self, get_response): | ||
def __init__(self, get_response: Callable) -> None: | ||
""" | ||
For debug purposes only. | ||
Link to local_settings by adding | ||
`blossom.middleware.BetterExceptionsMiddleware` | ||
to the top of the middleware stack. | ||
""" | ||
self.get_response = get_response | ||
|
||
def __call__(self, request): | ||
def __call__(self, request: HttpRequest) -> HttpResponse: | ||
"""Override call functionality.""" | ||
return self.get_response(request) | ||
|
||
def process_exception(self, request, exception): | ||
def process_exception(self, request: HttpRequest, exception: Exception) -> None: | ||
"""Allow BetterExceptions to hook into the running process.""" | ||
excepthook(exception.__class__, exception, sys.exc_info()[2]) | ||
return None |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
"""The place where all of our user-facing strings live.""" | ||
|
||
import os | ||
|
||
import toml | ||
from django.conf import settings | ||
|
||
|
||
def translation(lang='en_US'): | ||
def translation(lang: str = "en_US") -> dict: | ||
"""Load and provide the strings file.""" | ||
with open(os.path.join(settings.BASE_DIR, "strings", f"{lang}.toml"), "r") as f: | ||
return toml.loads(f.read()) |
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
Oops, something went wrong.