summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b187942)
raw | patch | inline | side by side (parent: b187942)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 17 Mar 2003 04:26:24 +0000 (04:26 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 17 Mar 2003 04:26:24 +0000 (04:26 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1594 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi/client.py | patch | blob | history |
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 6d8bdc703362de979ffa1ac454471af6e732ab4b..77a38a9bb9cf12b253e2cf609f4729e957fd1127 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.104 2003-03-09 22:57:47 richard Exp $
+# $Id: client.py,v 1.105 2003-03-17 04:26:24 richard Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
# create the new user
cl = self.db.user
# XXX we need to make the "default" page be able to display errors!
-# try:
- if 1:
+ try:
props['roles'] = self.instance.config.NEW_WEB_USER_ROLES
del props['__time']
self.userid = cl.create(**props)
# clear the props from the otk database
self.db.otks.destroy(otk)
self.db.commit()
-# except (ValueError, KeyError), message:
-# self.error_message.append(str(message))
-# return
+ except (ValueError, KeyError), message:
+ self.error_message.append(str(message))
+ return
# log the new user in
self.user = cl.get(self.userid, 'username')
newpw = ''.join([random.choice(self.chars) for x in range(8)])
cl = self.db.user
- # XXX we need to make the "default" page be able to display errors!
- # try:
- if 1:
+# XXX we need to make the "default" page be able to display errors!
+ try:
# set the password
cl.set(uid, password=password.Password(newpw))
# clear the props from the otk database
self.db.otks.destroy(otk)
self.db.commit()
- # except (ValueError, KeyError), message:
- # self.error_message.append(str(message))
- # return
+ except (ValueError, KeyError), message:
+ self.error_message.append(str(message))
+ return
# user info
address = self.db.user.get(uid, 'address')
See parsePropsFromForm and _editnodes for special variables
'''
# parse the props from the form
-# XXX reinstate exception handling
-# try:
- if 1:
+ try:
props, links = self.parsePropsFromForm()
-# except (ValueError, KeyError), message:
-# self.error_message.append(_('Error: ') + str(message))
-# return
+ except (ValueError, KeyError), message:
+ self.error_message.append(_('Error: ') + str(message))
+ return
# handle the props
-# XXX reinstate exception handling
-# try:
- if 1:
+ try:
message = self._editnodes(props, links)
-# except (ValueError, KeyError, IndexError), message:
-# self.error_message.append(_('Error: ') + str(message))
-# return
+ except (ValueError, KeyError, IndexError), message:
+ self.error_message.append(_('Error: ') + str(message))
+ return
# commit now that all the tricky stuff is done
self.db.commit()
special form values.
'''
# parse the props from the form
-# XXX reinstate exception handling
-# try:
- if 1:
+ try:
props, links = self.parsePropsFromForm()
-# except (ValueError, KeyError), message:
-# self.error_message.append(_('Error: ') + str(message))
-# return
+ except (ValueError, KeyError), message:
+ self.error_message.append(_('Error: ') + str(message))
+ return
# handle the props - edit or create
-# XXX reinstate exception handling
-# try:
- if 1:
- # create the context here
-# cn = self.classname
-# nid = self._createnode(cn, props[(cn, None)])
-# del props[(cn, None)]
-
+ try:
# when it hits the None element, it'll set self.nodeid
- messages = self._editnodes(props, links) #, {(cn, None): nid})
+ messages = self._editnodes(props, links)
-# except (ValueError, KeyError, IndexError), message:
-# # these errors might just be indicative of user dumbness
-# self.error_message.append(_('Error: ') + str(message))
-# return
+ except (ValueError, KeyError, IndexError), message:
+ # these errors might just be indicative of user dumbness
+ self.error_message.append(_('Error: ') + str(message))
+ return
# commit now that all the tricky stuff is done
self.db.commit()
+ print '%s%s%s?@ok_message=%s'%(self.base, self.classname,
+ self.nodeid, urllib.quote(messages))
# redirect to the new item's page
raise Redirect, '%s%s%s?@ok_message=%s'%(self.base, self.classname,
self.nodeid, urllib.quote(messages))