Skip to content

Commit

Permalink
Merge pull request #146 from ractf/feature/non-tiebreak-challenges
Browse files Browse the repository at this point in the history
Fix event name not being in email subjects
  • Loading branch information
david-cooke authored Jul 29, 2021
2 parents 3192cac + 904c71e commit 3911421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/authentication/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def create(self, validated_data):
try:
send_email(
user.email,
"RACTF - Verify your email",
f"{config.get('event_name')} - Verify your email",
"verify",
url=settings.FRONTEND_URL + "verify?id={}&secret={}".format(user.id, user.email_token),
event_name=config.get("event_name"),
Expand Down
7 changes: 4 additions & 3 deletions src/authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
verify_2fa,
)
from backend.viewsets import AdminListModelViewSet
from config import config
from plugins import providers
from team.models import Team

Expand Down Expand Up @@ -133,7 +134,7 @@ def post(self, request):
request.user.totp_device.delete()
request.user.save()
remove_2fa.send(sender=self.__class__, user=request.user)
send_email(request.user.email, "RACTF - 2FA Has Been Disabled", "2fa_removed")
send_email(request.user.email, f"{config.get('event_name')} - 2FA Has Been Disabled", "2fa_removed")
return FormattedResponse()
return FormattedResponse(status=HTTP_401_UNAUTHORIZED, m="code_incorrect")

Expand Down Expand Up @@ -208,7 +209,7 @@ def post(self, request):
if settings.MAIL["SEND"]:
send_email(
email,
"RACTF - Reset Your Password",
f"{config.get('event_name')} - Reset Your Password",
"password_reset",
url=settings.FRONTEND_URL + "password_reset?id={}&secret={}".format(uid, token),
)
Expand Down Expand Up @@ -284,7 +285,7 @@ def post(self, request):
user = serializer.validated_data["user"]
send_email(
user.email,
"RACTF - Verify your email",
f"{config.get('event_name')} - Verify your email",
"verify",
url=settings.FRONTEND_URL + "verify?id={}&secret={}".format(user.id, user.email_token),
)
Expand Down

0 comments on commit 3911421

Please sign in to comment.