mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Use render instead of redirect if registration/create fails
This commit is contained in:
parent
243f33ff91
commit
bae0be338a
5 changed files with 53 additions and 42 deletions
|
|
@ -8,7 +8,7 @@ class User < ActiveRecord::Base
|
|||
:confirmable
|
||||
|
||||
has_and_belongs_to_many :roles
|
||||
has_one :person
|
||||
has_one :person, :inverse_of => :user
|
||||
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :role_id, :role_ids, :person_attributes
|
||||
accepts_nested_attributes_for :person
|
||||
|
|
@ -50,7 +50,7 @@ class User < ActiveRecord::Base
|
|||
private
|
||||
def create_person
|
||||
# TODO Search people for existing email address, add to their account
|
||||
build_person(:email => self.email)
|
||||
build_person(:email => self.email) if person.nil?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue