Initial changes to move repositories from using a namespace string to referencing a user object. Also stores the user id in the cookie rather than the username, to allow users to be renamed. This commit must not be used unmodified because the database migration is too aggressive for live migration.

This commit is contained in:
Jake Moshenko 2014-09-18 14:52:29 -04:00
parent 8c00eabedd
commit 8626d1cd70
7 changed files with 87 additions and 28 deletions

View file

@ -560,6 +560,13 @@ def get_user_or_org(username):
return None
def get_user_by_id(user_dbid):
try:
return User.get(User.id == user_dbid, User.organization == False)
except User.DoesNotExist:
return None
def get_user_or_org_by_customer_id(customer_id):
try:
return User.get(User.stripe_id == customer_id)