2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

Refactor + Fix: Wasn't correctly loading activity streams. Code is a lot more Ember-y now.

This commit is contained in:
Robin Ward 2013-05-22 11:20:16 -04:00
parent 89a617f0c6
commit 0f296cd42b
15 changed files with 198 additions and 187 deletions

View file

@ -175,6 +175,19 @@ class ApplicationController < ActionController::Base
end
end
def fetch_user_from_params
username_lower = params[:username].downcase
username_lower.gsub!(/\.json$/, '')
user = User.where(username_lower: username_lower).first
raise Discourse::NotFound.new if user.blank?
guardian.ensure_can_see!(user)
user
end
private
def render_json_error(obj)