~petersanchez/public-inbox

django-impersonate: Downgrade signals logging from warning to debug v1 APPLIED

Hugo Rodger-Brown: 1
 Downgrade signals logging from warning to debug

 1 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.code.netlandish.com/~petersanchez/public-inbox/patches/7/mbox | git am -3
Learn more about email & git

[PATCH django-impersonate] Downgrade signals logging from warning to debug Export this patch

# HG changeset patch
# User Hugo Rodger-Brown <hugo@yunojuno.com>
# Date 1607608487 0
#      Thu Dec 10 13:54:47 2020 +0000
# Branch downgrade-logging
# Node ID bd1429321fb4a7f4627448681d369d07875c5edf
# Parent  a174b1c67a73699e1ea51d1433db7d0f22c4e6ef
Downgrade signals logging from warning to debug

In production we are seeing the warnings raised by the
signals appearing frequently. I believe this is caused by
people having multiple tabs open, stopping impersonating
in one, and then some time later clicking the stop impersonate
link in another. This is a completely valid use case, and
shouldn't raise a warning.

diff --git a/impersonate/signals.py b/impersonate/signals.py
--- a/impersonate/signals.py
+++ b/impersonate/signals.py
@@ -87,7 +87,7 @@
        log.session_ended_at = tz_now()
        log.save()
    except ImpersonationLog.DoesNotExist:
        logger.warning(
        logger.debug(
            (u'Unfinished ImpersonationLog could not be found for: '
             u'{0}, {1}, {2}').format(
                 impersonator,
@@ -96,7 +96,7 @@
             )
        )
    except ImpersonationLog.MultipleObjectsReturned:
        logger.warning(
        logger.debug(
            (u'Multiple unfinished ImpersonationLog matching: '
             u'{0}, {1}, {2}').format(
                 impersonator,
Thanks! This was applied.