Skip to content
Extraits de code Groupes Projets
Valider e2bdd54d rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Undo part of the refactor so that StatusMessage validations work.

parent caf26a5c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -40,14 +40,14 @@ class StatusMessagesController < ApplicationController
@status_message = current_user.build_post(:status_message, params[:status_message])
photos = Photo.where(:id => [*params[:photos]], :diaspora_handle => current_user.person.diaspora_handle)
unless photos.empty?
@status_message.photos << photos
end
if @status_message.save
Rails.logger.info("event=create type=status_message chars=#{params[:status_message][:text].length}")
photos = Photo.where(:id => [*params[:photos]], :diaspora_handle => current_user.person.diaspora_handle)
if !photos.empty?
@status_message.photos << photos
end
aspects = current_user.aspects_from_ids(params[:aspect_ids])
current_user.add_to_streams(@status_message, aspects)
receiving_services = current_user.services.where( :type => params[:services].map{|s| "Services::"+s.titleize}) if params[:services]
......@@ -64,6 +64,9 @@ class StatusMessagesController < ApplicationController
format.mobile{ redirect_to root_url}
end
else
unless photos.empty?
photos.update_all(:status_message_guid => nil)
end
respond_to do |format|
format.js {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter