Mercurial > p > roundup > code
changeset 464:29f5ac8a0d2b
Fixed bugs:
. Fixed file creation and retrieval in same transaction in anydbm
backend
. Cgi interface now renders new issue after issue creation
. Could not set issue status to resolved through cgi interface
. Mail gateway was changing status back to 'chatting' if status was
omitted as an argument
| author | Roche Compaan <rochecompaan@users.sourceforge.net> |
|---|---|
| date | Tue, 18 Dec 2001 15:30:34 +0000 |
| parents | 045f7fcc2c0f |
| children | 70b0809cd15c |
| files | roundup/backends/back_anydbm.py roundup/cgi_client.py roundup/mailgw.py |
| diffstat | 3 files changed, 50 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Tue Dec 18 05:05:14 2001 +0000 +++ b/roundup/backends/back_anydbm.py Tue Dec 18 15:30:34 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.19 2001-12-17 03:52:48 richard Exp $ +#$Id: back_anydbm.py,v 1.20 2001-12-18 15:30:34 rochecompaan Exp $ ''' This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python @@ -272,7 +272,11 @@ def getfile(self, classname, nodeid, property): '''Store the content of the file in the database. ''' - return open(self.filename(classname, nodeid, property), 'rb').read() + filename = self.filename(classname, nodeid, property) + try: + return open(filename, 'rb').read() + except: + return open(filename+'.tmp', 'rb').read() # @@ -398,6 +402,13 @@ # #$Log: not supported by cvs2svn $ +#Revision 1.19 2001/12/17 03:52:48 richard +#Implemented file store rollback. As a bonus, the hyperdb is now capable of +#storing more than one file per node - if a property name is supplied, +#the file is called designator.property. +#I decided not to migrate the existing files stored over to the new naming +#scheme - the FileClass just doesn't specify the property name. +# #Revision 1.18 2001/12/16 10:53:38 richard #take a copy of the node dict so that the subsequent set #operation doesn't modify the oldvalues structure
--- a/roundup/cgi_client.py Tue Dec 18 05:05:14 2001 +0000 +++ b/roundup/cgi_client.py Tue Dec 18 15:30:34 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: cgi_client.py,v 1.83 2001-12-15 23:51:01 richard Exp $ +# $Id: cgi_client.py,v 1.84 2001-12-18 15:30:30 rochecompaan Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -360,10 +360,11 @@ unread_id = self.db.status.lookup('unread') resolved_id = self.db.status.lookup('resolved') chatting_id = self.db.status.lookup('chatting') + current_status = cl.get(self.nodeid, 'status') except KeyError: pass else: - if (props['status'] == unread_id or props['status'] == resolved_id): + if (props['status'] == unread_id or props['status'] == resolved_id and current_status == resolved_id): props['status'] = chatting_id # add assignedto to the nosy list if props.has_key('assignedto'): @@ -536,20 +537,31 @@ self._post_editnode(nid) # and some nice feedback for the user message = _('%(classname)s created ok')%{'classname': cn} + + self.db.commit() + # render the newly created issue + self.nodeid = nid + self.pagehead('%s: %s'%(self.classname.capitalize(), nid), + message) + item = htmltemplate.ItemTemplate(self, self.TEMPLATES, + self.classname) + item.render(nid) + self.pagefoot() except: self.db.rollback() s = StringIO.StringIO() traceback.print_exc(None, s) message = '<pre>%s</pre>'%cgi.escape(s.getvalue()) - self.pagehead(_('New %(classname)s')%{'classname': - self.classname.capitalize()}, message) + else: + self.pagehead(_('New %(classname)s')%{'classname': + self.classname.capitalize()}, message) - # call the template - newitem = htmltemplate.NewItemTemplate(self, self.TEMPLATES, - self.classname) - newitem.render(self.form) + # call the template + newitem = htmltemplate.NewItemTemplate(self, self.TEMPLATES, + self.classname) + newitem.render(self.form) - self.pagefoot() + self.pagefoot() newissue = newnode def newuser(self, message=None): @@ -1150,6 +1162,15 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.83 2001/12/15 23:51:01 richard +# Tested the changes and fixed a few problems: +# . files are now attached to the issue as well as the message +# . newuser is a real method now since we don't want to do the message/file +# stuff for it +# . added some documentation +# The really big changes in the diff are a result of me moving some code +# around to keep like methods together a bit better. +# # Revision 1.82 2001/12/15 19:24:39 rochecompaan # . Modified cgi interface to change properties only once all changes are # collected, files created and messages generated.
--- a/roundup/mailgw.py Tue Dec 18 05:05:14 2001 +0000 +++ b/roundup/mailgw.py Tue Dec 18 15:30:34 2001 +0000 @@ -73,7 +73,7 @@ an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.43 2001-12-15 19:39:01 rochecompaan Exp $ +$Id: mailgw.py,v 1.44 2001-12-18 15:30:34 rochecompaan Exp $ ''' @@ -488,9 +488,9 @@ except KeyError: pass else: - if (not props.has_key('status') or - props['status'] == unread_id or - props['status'] == resolved_id): + if (not props.has_key('status') and + properties['status'] == unread_id or + properties['status'] == resolved_id): props['status'] = chatting_id # add nosy in arguments to issue's nosy list @@ -638,6 +638,9 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.43 2001/12/15 19:39:01 rochecompaan +# Oops. +# # Revision 1.42 2001/12/15 19:24:39 rochecompaan # . Modified cgi interface to change properties only once all changes are # collected, files created and messages generated.
