summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/hosting/server/accounts.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-01-03 07:41:53 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-01-03 07:41:53 +0000
commitd7069b5a2e7859ab14c5a909d5e5fc6bc84b80cb (patch)
treed8027520fb22c176f54e860c0d2ebd000b1c457f /sca-cpp/trunk/hosting/server/accounts.py
parent9e1b9e73145e00ea591bd1e0e9777625bad66dc9 (diff)
Improve app hosting management app, restructure UI and refactor REST services and data model to use an SQL database.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1428193 13f79535-47bb-0310-9956-ffa450edef68
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)