Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAM-Patch #201

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions app/lib/personal_for_you.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ def acct_relay_users
def mammoth_user(acct)
user = user(acct)
return user unless user[:for_you_settings][:type] == 'public'

# if for_you is public get the waitlist
waitlist = waitlist_status(acct)
if waitlist == 'enrolled'
user[:for_you_settings][:type] = 'waitlist'
end
user[:for_you_settings][:type] = 'waitlist' if waitlist == 'enrolled'
user
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assign 'waitlist' if it's enrolled

end

Expand All @@ -82,7 +81,7 @@ def waitlist_status(acct)
response = HTTP.headers({ Authorization: ACCOUNT_RELAY_AUTH, 'Content-Type': 'application/json' }).get(
"https://#{FEATURE_HOST}/api/v1/personalize?acct=#{acct}"
)
JSON.parse(response.body, symbolize_names: true)[:waitlist]
JSON.parse(response.body, symbolize_names: true)[:status]
end

# Defined as a 'personalize' user on AccountRelay
Expand Down