If you prefer, I can explain what's going on in comments, but in short:

We previously did not take into account the status of the user's current version unless it appeared to be a beta. We now take it into account for every version, and remove the unnecessary beta version regexp check.

Since we're now doing this for every query, I decided to change the status check from multiple queries to a single query with a join, and the necessary mostly in SQL rather than python.

The changes in logic are, essentially:

* Beta updates will now be served for beta versions regardless of whether they match the version regexp.
* Preliminary reviewed updates will no longer be served as updates for versions with full review.