Commit ee66cbf8e2ea7857d3dc12dbce7adec2825f2fc1
1 parent
ca2910bc
fix siorg being required
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/noosfero-spb/gov_user/lib/institution.rb
... | ... | @@ -49,7 +49,7 @@ class Institution < ActiveRecord::Base |
49 | 49 | :verify_institution_type, :verify_siorg_code |
50 | 50 | |
51 | 51 | def verify_siorg_code |
52 | - if (self.siorg_code =~ /^[0-9]+$/).nil? | |
52 | + if (self.siorg_code.present? && (self.siorg_code =~ /^[0-9]+$/).nil?) | |
53 | 53 | self.errors.add( |
54 | 54 | :siorg_code, |
55 | 55 | _("invalid, only numbers are allowed.") | ... | ... |