diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index b5b45e6..1e5c2b4 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -97,6 +97,7 @@ class AccountController < ApplicationController @user.return_to = session[:return_to] @person = Person.new(params[:profile_data]) @person.environment = @user.environment + if request.post? if may_be_a_bot set_signup_start_time_for_now @@ -115,6 +116,14 @@ class AccountController < ApplicationController invitation.update_attributes!({:friend => @user.person}) invitation.finish end + + unless params[:file].nil? + image = Image::new :uploaded_data=> params[:file][:image] + + @user.person.image = image + @user.person.save + end + if @user.activated? self.current_user = @user check_join_in_community(@user) diff --git a/app/views/profile_editor/_person_form.html.erb b/app/views/profile_editor/_person_form.html.erb index 12fbc65..a2bd218 100644 --- a/app/views/profile_editor/_person_form.html.erb +++ b/app/views/profile_editor/_person_form.html.erb @@ -25,7 +25,7 @@ <%= optional_field(@person, 'address', labelled_form_field(_('Address (street and number)'), text_field(:profile_data, :address, :rel => _('Address')))) %> <%= optional_field(@person, 'address_reference', labelled_form_field(_('Address reference'), text_field(:profile_data, :address_reference, :rel => _('Address reference')))) %> <%= optional_field(@person, 'district', labelled_form_field(_('District'), text_field(:profile_data, :district, :rel => _('District')))) %> -<%= optional_field(@person, 'image', labelled_form_field(_('Image'), file_field(:profile_data, :image, :rel => _('Image')))) %> +<%= optional_field(@person, 'image', labelled_form_field(_('Image'), file_field(:file, :image, :rel => _('Image')))) %> <% optional_field(@person, 'schooling') do %>