From bcf2709f636a3a48421d68fd794ae00ef4456706 Mon Sep 17 00:00:00 2001 From: inv-amalusudhakaran Date: Thu, 26 Sep 2024 09:25:47 +0530 Subject: [PATCH] Make user active status configurable --- onadata/libs/serializers/user_profile_serializer.py | 2 +- onadata/settings/common.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/onadata/libs/serializers/user_profile_serializer.py b/onadata/libs/serializers/user_profile_serializer.py index 713071d8ce..c034c6e6b8 100644 --- a/onadata/libs/serializers/user_profile_serializer.py +++ b/onadata/libs/serializers/user_profile_serializer.py @@ -299,7 +299,7 @@ def create(self, validated_data): new_user.delete() raise serializers.ValidationError({"password": e.messages}) - new_user.is_active = True + new_user.is_active = settings.USER_ACTIVE_BY_DEFAULT new_user.first_name = params.get("first_name") new_user.last_name = params.get("last_name") new_user.save() diff --git a/onadata/settings/common.py b/onadata/settings/common.py index 9e1ab922ce..d60aa509d3 100644 --- a/onadata/settings/common.py +++ b/onadata/settings/common.py @@ -719,3 +719,5 @@ def configure_logging(logger, **kwargs): "'sha256-52i34Zg+qg4/kTYjnNHEmW8jhzGRxjt77FX9aveiXqw='", ] CSP_INCLUDE_NONCE_IN = ["script-src", "style-src"] + +USER_ACTIVE_BY_DEFAULT = True \ No newline at end of file