MinimalController calls set_content_type(), which
in some cases references c.response_wrappers. However,
MinimalController was not setting c.response_wrappers to
a list, which caused an error.
Promos can have approved "viewers" but they shouldn't be able to edit traffic
settings. This change hides the Settings tab unless the user is owner of the
promo or an admin.
This prevents an issue where registration_ip is not set on the account
object causing downstream code to break. This happened because the app
would crash for whatever reason between committing in register() and
adding the IP and committing again in ApiController:_handle_register.
This should protect us against partial commits leading to broken things
that have fewer data attributes than they're supposed to. It should
also improve Postgres performance as we'll be doing fewer total
transactions.
Splits promo traffic apart into tabs: one for the link traffic, one that shows
campaign traffic stats in a table, and another tab for settings (which is just
viewer list right now.)
Gated by VSponsorAdmin for testing/feedback.
Updates traffic viewer emails to use new message string locations. Fixes
a bug that was preventing emails from being sent when a new traffic viewer
was added.
Allows admins/sponsors to edit some campaign fields even after the ad has gone
live. Target can be changed at any time. Bid can only be changed for freebies.
Items at the end of the query are almost guaranteed to be a huge jump
from those in the non-pruned part of the query. To avoid confusion,
we'll cut off the query at MAX_CACHED_ITEMS which is still imperfect,
but better.
Using safe_set_attr makes the Account not dirty, but it sets the
attributes directly on the object rather than in the _t dict. If the
account was later _commit()'ed it would get stuck with these extra
attributes.
If a client sends a user to the authorization page with a
"duration=permanent" parameter, we'll create a refresh token in addition
to the initial access token. When the client fetches the initial access
token with the authorization code, the refresh token will also be returned.
The client can then obtain new access tokens using the refresh token
instead of an authorization code.
Both refresh tokens and access tokens will be displayed on the user's apps
page (as well as the IP history page).
Promotion calendar code was still using the link.campaigns attribute which
no longer exists. This change updates it to use PromoCampaign things instead.
Fixes a bug where new promotions were not showing up in promoted/graph.