diaspora/app/controllers/registrations_controller.rb
Alec Leamas 1481056af2 Revert "Merge remote branch 'upstream/master'"
This reverts commit fb70dc8c99, reversing
changes made to 53fef63a9a.

Conflicts:

	pkg/fedora/diaspora-setup
	pkg/ubuntu/diaspora-setup
	public/stylesheets/sass/application.sass
	spec/models/user/attack_vectors_spec.rb
2010-10-20 14:59:55 +02:00

25 lines
698 B
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class RegistrationsController < Devise::RegistrationsController
def create
begin
user = User.instantiate!(params[:user])
rescue MongoMapper::DocumentNotValid => e
flash[:error] = e.message
redirect_to new_user_registration_path
end
if user.save
flash[:notice] = I18n.t 'registrations.create.success'
sign_in_and_redirect(:user, user)
else
flash[:error] = user.errors.full_messages.join(', ')
redirect_to new_user_registration_path
end
end
def update
super
end
end