Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions hypha/apply/users/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@ def _get_url_params(self) -> None | str:

return None

def send_email_no_account_found(self, to):
subject = f"Log in attempt at {settings.ORG_LONG_NAME}"
# Force subject to a single line to avoid header-injection issues.
subject = "".join(subject.splitlines())

email = MarkdownMail("users/emails/passwordless_login_no_account_found.md")
email.send(to=to, subject=subject, from_email=settings.DEFAULT_FROM_EMAIL)

def send_login_email(self, user):
login_path = self._get_login_path(user)
timeout_minutes = self.login_token_generator_class().TIMEOUT // 60
Expand Down Expand Up @@ -162,9 +154,8 @@ def initiate_login_signup(self, email: str) -> None:
self.send_login_email(user)
return

# No account found
# No account found and no public signup, do nothing.
if not settings.ENABLE_PUBLIC_SIGNUP:
self.send_email_no_account_found(email)
return

# Self registration is enabled
Expand All @@ -175,5 +166,3 @@ def initiate_login_signup(self, email: str) -> None:
},
)
self.send_new_account_login_email(signup_obj)

return True

This file was deleted.

Loading