only redirect on html requests

This commit is contained in:
Dennis Collinson 2012-04-24 21:01:19 -07:00
parent 7346921473
commit 2cbf383fbb

View file

@ -82,11 +82,12 @@ class PeopleController < ApplicationController
def show
@person = Person.find_from_guid_or_username(params)
flag = FeatureFlagger.new(current_user)
logger.info(request.format)
raise(ActiveRecord::RecordNotFound) if remote_profile_with_no_user_session?
return redirect_to :back, :notice => t("people.show.closed_account") if @person.closed_account?
return redirect_to person_path(@person) if params[:ex] && !flag.new_profile?
return redirect_to person_path(@person, :ex => true) if !params[:ex] && flag.new_profile? && flag.new_hotness?
return redirect_to person_path(@person, :ex => true) if !params[:ex] && flag.new_profile? && flag.new_hotness? && request.format == "text/html"
@post_type = :all
@aspect = :profile