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:
parent
89a617f0c6
commit
0f296cd42b
15 changed files with 198 additions and 187 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue