Skip to content

Commit

Permalink
add validation with registration_form
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbaraOliveira13 committed Aug 30, 2024
1 parent c82e48f commit 6847909
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Decidim
module FriendlySignup
class RegistrationFormOverride < Decidim::RegistrationForm
validate :no_special_characters_in_email

private

def no_special_characters_in_email
if email =~ /[<>'"]/
errors.add(:email, "contains invalid characters")
end
end
end
end
end
13 changes: 0 additions & 13 deletions app/validators/email_validators.rb

This file was deleted.

0 comments on commit 6847909

Please sign in to comment.