IZ we update profile in zombie friends accept

This commit is contained in:
ilya 2010-08-24 14:22:21 -07:00
parent fa6e12d808
commit a70132fcdc
2 changed files with 15 additions and 2 deletions

View file

@ -37,6 +37,8 @@ def warzombie
def zombiefriendaccept def zombiefriendaccept
render :nothing => true render :nothing => true
set_profile_photo
Request.all.each{|r| Request.all.each{|r|
current_user.accept_and_respond(r.id, current_user.groups.first.id) current_user.accept_and_respond(r.id, current_user.groups.first.id)
} }
@ -54,4 +56,14 @@ def warzombie
file.write(seed_num_hash.to_yaml) file.write(seed_num_hash.to_yaml)
file.close file.close
end end
def set_profile_photo
album = current_user.post(:album, :name => "Profile Photos")
username = backer_info[backer_number]['username'].gsub(/ /,'').downcase
photo = current_user.post(:photo, :album_id => album.id,
:user_file => "public/images/users/#{username}.jpg")
current_user.update_profile(:image_url => photo.url)
end
end end

View file

@ -19,11 +19,12 @@ def create
:password => "#{username+backer_info[backer_number]['pin'].to_s}", :password => "#{username+backer_info[backer_number]['pin'].to_s}",
:person => Person.new( :person => Person.new(
:email => "#{username}@#{username}.joindiaspora.com", :email => "#{username}@#{username}.joindiaspora.com",
:profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'] :profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'],
, :image_url => "http://#{username}.joindiaspora.com/images/users/#{username}.jpg"), :image_url => "http://#{username}.joindiaspora.com/images/users/#{username}.jpg"),
:url=> "http://#{username}.joindiaspora.com/") :url=> "http://#{username}.joindiaspora.com/")
) )
user.person.save user.person.save
user.group(:name => "Presidents") user.group(:name => "Presidents")
end end