aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/user_controller.rb5
-rw-r--r--app/models/profile_photo.rb5
-rw-r--r--app/views/user/set_draft_profile_photo.rhtml2
3 files changed, 3 insertions, 9 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index e2bfa7da9..e9b5f8676 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -357,11 +357,6 @@ class UserController < ApplicationController
file_name = params[:file].original_filename
file_content = params[:file].read
end
- if file_name.nil?
- flash[:error] = "Please choose a file containing your photo"
- render :template => 'user/set_draft_profile_photo.rhtml'
- return
- end
# validate it
@draft_profile_photo = ProfilePhoto.new(:data => file_content, :draft => true)
diff --git a/app/models/profile_photo.rb b/app/models/profile_photo.rb
index 26fa34f05..0c04286f6 100644
--- a/app/models/profile_photo.rb
+++ b/app/models/profile_photo.rb
@@ -45,7 +45,6 @@ class ProfilePhoto < ActiveRecord::Base
image_list.from_blob(data)
rescue Magick::ImageMagickError
self.image = nil
- write_attribute(:data, nil)
return
end
@@ -89,12 +88,12 @@ class ProfilePhoto < ActiveRecord::Base
def validate
if self.data.nil?
- errors.add(:data, "^No image specified")
+ errors.add(:data, "^Please choose a file containing your photo.")
return
end
if self.image.nil?
- errors.add(:data, "^Couldn't read the image that you uploaded, please try again.")
+ errors.add(:data, "^Couldn't understand the image file that you uploaded. PNG, JPEG, GIF and many other common image file formats are supported.")
return
end
diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.rhtml
index 13ca402c2..c41ab611e 100644
--- a/app/views/user/set_draft_profile_photo.rhtml
+++ b/app/views/user/set_draft_profile_photo.rhtml
@@ -4,7 +4,7 @@
<h2>Choose your profile photo</h2>
-<%= foi_error_messages_for :set_profile_photo %>
+<%= foi_error_messages_for :draft_profile_photo %>
<div id="set_draft_profile_photo">