From 1f8f07f48dc266ecc817eda249beee369fb3e425 Mon Sep 17 00:00:00 2001
From: maxwell <maxwell@joindiaspora.com>
Date: Wed, 8 Dec 2010 14:05:30 -0800
Subject: [PATCH] added slightly better error message on aspect update failure

---
 app/controllers/aspects_controller.rb | 7 ++++---
 config/locales/diaspora/en.yml        | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb
index 45e7bcc26b..ad49b83582 100644
--- a/app/controllers/aspects_controller.rb
+++ b/app/controllers/aspects_controller.rb
@@ -83,9 +83,10 @@ class AspectsController < ApplicationController
 
   def update
     @aspect = current_user.aspect_by_id(params[:id])
-
-    @aspect.update_attributes( params[:aspect] )
-    flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name
+    if @aspect.update_attributes( params[:aspect] )
+      flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name
+    else
+      flash[:notice] = I18n.t 'aspects.update.failure',:name => @aspect.name
     respond_with @aspect
   end
 
diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml
index 99796c8903..4eff0acb15 100644
--- a/config/locales/diaspora/en.yml
+++ b/config/locales/diaspora/en.yml
@@ -144,6 +144,7 @@ en:
           success: "%{name} was successfully removed."
       update:
           success: "Your aspect, %{name}, has been successfully edited."
+          failure: "Your aspect, %{name}, had too long name to be saved."
       move_contact:
           failure: "didn't work %{inspect}"
           success: "Person moved to new aspect"
-- 
GitLab