summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/hosting/server/accounts.py
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/hosting/server/accounts.py')
-rw-r--r--sca-cpp/trunk/hosting/server/accounts.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/sca-cpp/trunk/hosting/server/accounts.py b/sca-cpp/trunk/hosting/server/accounts.py
index 3587f5fb65..99655620f1 100644
--- a/sca-cpp/trunk/hosting/server/accounts.py
+++ b/sca-cpp/trunk/hosting/server/accounts.py
@@ -16,8 +16,9 @@
# under the License.
# Accounts collection implementation
-from time import strftime
from util import *
+from atomutil import *
+from sys import debug
# Convert a particular user id to an account id
def accountid(user):
@@ -25,12 +26,17 @@ def accountid(user):
# Get the current user's account
def get(id, user, cache):
+ debug('accounts.py::get::id', id)
account = cache.get(accountid(user))
- if isNil(account) or account is None:
- return (("'entry", ("'title", user.get(())), ("'id", user.get(())), ("'updated", strftime('%b %d, %Y'))),)
+ if isNil(account):
+ return mkentry(user.get(()), user.get(()), user.get(()), now(), ())
return account
# Update the user's account
def put(id, account, user, cache):
- return cache.put(accountid(user), account)
+ debug('accounts.py::put::id', id)
+ debug('accounts.py::put::account', account)
+
+ accountentry = mkentry(title(account), user.get(()), user.get(()), now(), content(account))
+ return cache.put(accountid(user), accountentry)