Commit 10263282 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

astakos: Don't inform users when suspending from script

Add option to user-check command to operate silently, ie without
sending email to affected users.
parent ba901431
......@@ -32,7 +32,7 @@ The upgrade to v0.18 consists of the following steps:
.. code-block:: console
astakos.host$ snf-manage user-check --all-users --suspend-deactivated --fix
astakos.host$ snf-manage user-check --all-users --suspend-deactivated --noemail --fix
#. Start gunicorn
......
......@@ -23,6 +23,7 @@ from snf_django.management.commands import SynnefoCommand, CommandError
from astakos.im.models import AstakosUser
from astakos.im import functions, activation_backends
from django.conf import settings
SUSPENSION_REASON = activation_backends.PROJECT_SUSPENSION_REASON
......@@ -44,6 +45,10 @@ class Command(SynnefoCommand):
action="store_true",
default=False,
help="Apply actions"),
make_option('--noemail',
action="store_true",
default=False,
help="Don't send email to affected users"),
)
def get_user(self, query, userid):
......@@ -63,6 +68,10 @@ class Command(SynnefoCommand):
"or a valid user UUID"))
def handle(self, *args, **options):
if options["noemail"]:
settings.EMAIL_BACKEND = \
"django.core.mail.backends.dummy.EmailBackend"
fix = options["fix"]
all_users = options["all_users"]
if not (all_users ^ bool(args)):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment