Skip to content

Commit f2068a8

Browse files
committed
Ban *@ad.helsinki.fi emails
1 parent a195d30 commit f2068a8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/models/user.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,6 @@ def reject_common_login_mistakes
304304
return if !login || login.empty?
305305
errors.add(:login, "may not be your email address. Keep in mind that your username is public to everyone.") if login.include?('@')
306306
errors.add(:login, "may not be a number. Use the organizational identifier field for your student number.") if login.scan(/\D/).empty?
307+
errors.add(:email, 'may not end with "@ad.helsinki.fi". You cannot receive any emails with this address -- it\'s only used for your webmail login. Remove the "ad."-part of the address and try again.') if email.end_with?('@ad.helsinki.fi')
307308
end
308309
end

0 commit comments

Comments
 (0)