From 38e3cc6bb7790b563f94c2880d62efb1a02fabca Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 24 Jun 2018 19:51:09 +0200 Subject: [PATCH] Fix the debug mode --- activitypub.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/activitypub.py b/activitypub.py index d5a61ed..0b0d8a3 100644 --- a/activitypub.py +++ b/activitypub.py @@ -1,4 +1,5 @@ import logging +import os from datetime import datetime from typing import Any from typing import Dict @@ -17,6 +18,7 @@ from config import ID from config import ME from config import USER_AGENT from config import USERNAME +from little_boxes import strtobool from little_boxes import activitypub as ap from little_boxes.backend import Backend from little_boxes.collection import parse_collection as ap_parse_collection @@ -54,6 +56,9 @@ def ensure_it_is_me(f): class MicroblogPubBackend(Backend): """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: """Setup a custom user agent.""" return USER_AGENT