diff --git a/zenodo/modules/spam/templates/zenodo_spam/email/spam_user_email.tpl b/zenodo/modules/spam/templates/zenodo_spam/email/spam_user_email.tpl index 28b967102..e7e3a7426 100644 --- a/zenodo/modules/spam/templates/zenodo_spam/email/spam_user_email.tpl +++ b/zenodo/modules/spam/templates/zenodo_spam/email/spam_user_email.tpl @@ -22,12 +22,12 @@ # as an Intergovernmental Organization or submit itself to any jurisdiction. -#} {% if community %} -{% set content_text = 'the creation of the community with ID: ' + {{ community.id }} %} +{% set content_text = 'the creation of the community with ID: ' + community.id %} {% else %} -{% set content_text = 'the publication of your deposit titled: ' + {{ deposit.title }} %} +{% set content_text = 'the publication of your deposit titled: ' + deposit.title %} {% endif %} -Our spam protection system has classified {{content_text}} as potential spam content. +Our spam protection system has classified {{ content_text }} as potential spam content. As a preventive measure, we have deactivated your user account. We sincerely apologize if this was a mistake, in which case, please contact us on our support line at https://zenodo.org/support. diff --git a/zenodo/modules/spam/utils.py b/zenodo/modules/spam/utils.py index f190fa3e0..7cf72d8c9 100644 --- a/zenodo/modules/spam/utils.py +++ b/zenodo/modules/spam/utils.py @@ -89,7 +89,8 @@ def check_and_handle_spam(community=None, deposit=None): Q('query_string', query="owners:{}".format( community.id_user))).count() has_communities = Community.query.filter_by( - id_user=community.id_user).count() + id_user=community.id_user).count() - 1 + if not (has_records or has_communities): current_app.config['ZENODO_SPAM_HANDLING_ACTIONS']( community=community, deposit=deposit)