Skip to content

Commit

Permalink
Make SMS template configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Jan 14, 2025
1 parent 4b7e7e5 commit 373e3c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 2 additions & 5 deletions care/emr/api/otp_viewsets/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def rand_pass(size):
if not settings.USE_SMS:
return "45612"

return "".join(
secrets.choice(string.ascii_uppercase + string.digits) for _ in range(size)
)
return "".join(secrets.choice(string.digits) for _ in range(size))


class OTPLoginRequestSpec(BaseModel):
Expand Down Expand Up @@ -64,8 +62,7 @@ def send(self, request):
send_sms(
data.phone_number,
(
f"Open Healthcare Network Patient Management System Login, OTP is {random_otp} . "
"Please do not share this Confidential Login Token with anyone else"
f"Kerala Care Login, OTP {random_otp}. Please do not share this Confidential Login Token with anyone else"
),
)
except Exception as e:
Expand Down
4 changes: 4 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,10 @@
# SMS
# ------------------------------------------------------------------------------
USE_SMS = False
SMS_TEMPLATE = env(
"SMS_TEMPLATE",
default="Open Healthcare Network Patient Management System Login, OTP is {} Please do not share this Confidential Login Token with anyone else",
)

# Push Notifications
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 373e3c6

Please sign in to comment.