Fix the debug mode
This commit is contained in:
parent
c85fb8530e
commit
38e3cc6bb7
1 changed files with 5 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
@ -17,6 +18,7 @@ from config import ID
|
||||||
from config import ME
|
from config import ME
|
||||||
from config import USER_AGENT
|
from config import USER_AGENT
|
||||||
from config import USERNAME
|
from config import USERNAME
|
||||||
|
from little_boxes import strtobool
|
||||||
from little_boxes import activitypub as ap
|
from little_boxes import activitypub as ap
|
||||||
from little_boxes.backend import Backend
|
from little_boxes.backend import Backend
|
||||||
from little_boxes.collection import parse_collection as ap_parse_collection
|
from little_boxes.collection import parse_collection as ap_parse_collection
|
||||||
|
@ -54,6 +56,9 @@ def ensure_it_is_me(f):
|
||||||
class MicroblogPubBackend(Backend):
|
class MicroblogPubBackend(Backend):
|
||||||
"""Implements a Little Boxes backend, backed by MongoDB."""
|
"""Implements a Little Boxes backend, backed by MongoDB."""
|
||||||
|
|
||||||
|
def debug_mode(self) -> bool:
|
||||||
|
return strtobool(os.getenv("MICROBLOGPUB_DEBUG", "false"))
|
||||||
|
|
||||||
def user_agent(self) -> str:
|
def user_agent(self) -> str:
|
||||||
"""Setup a custom user agent."""
|
"""Setup a custom user agent."""
|
||||||
return USER_AGENT
|
return USER_AGENT
|
||||||
|
|
Loading…
Reference in a new issue