Set email on empty

This commit is contained in:
Ari Timonen 2020-04-14 01:46:39 +03:00
parent e1747cac83
commit 1c59cac569

View file

@ -359,6 +359,7 @@ class User < ActiveRecord::Base
unless profile&.present? unless profile&.present?
self.build_profile self.build_profile
end end
self.email = "%s@ensl.org" % cleanup_string(username) if email.blank?
end end
def generate_password def generate_password