Issue #1275936 by webflo, Dane Powell: Prevent recursion when called from other modules (e.g. notifications or mailcomment).