From: richard Date: Tue, 10 Sep 2002 08:04:57 +0000 (+0000) Subject: Made "creator" property a String like it should be (we can't lookup() X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=51f16da93fca36a7766fc79bccf187ac20fea152;p=roundup.git Made "creator" property a String like it should be (we can't lookup() retired users reliably) git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1120 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/backends/back_anydbm.py b/roundup/backends/back_anydbm.py index 2a338a0..db18814 100644 --- a/roundup/backends/back_anydbm.py +++ b/roundup/backends/back_anydbm.py @@ -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.73 2002-09-10 00:11:49 richard Exp $ +#$Id: back_anydbm.py,v 1.74 2002-09-10 08:04:56 richard 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 @@ -976,14 +976,9 @@ class Class(hyperdb.Class): raise ValueError, 'Journalling is disabled for this class' journal = self.db.getjournal(self.classname, nodeid) if journal: - name = self.db.getjournal(self.classname, nodeid)[0][2] + return self.db.getjournal(self.classname, nodeid)[0][2] else: - return None - try: - return self.db.user.lookup(name) - except KeyError: - # the journaltag user doesn't exist any more - return None + return self.db.journaltag # get the property (raises KeyErorr if invalid) prop = self.properties[propname] @@ -1734,7 +1729,9 @@ class Class(hyperdb.Class): d['id'] = String() d['creation'] = hyperdb.Date() d['activity'] = hyperdb.Date() - d['creator'] = hyperdb.Link("user") + # can't be a link to user because the user might have been + # retired since the journal entry was created + d['creator'] = hyperdb.String() return d def addprop(self, **properties): diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index f133edb..124f97d 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -227,9 +227,6 @@ class HTMLClass: # we don't exist if item == 'id': return None - if item == 'creator': - # but we will be created by this user... - return HTMLUser(self._client, 'user', self._client.userid) # get the property prop = self._props[item] @@ -768,7 +765,7 @@ class LinkHTMLProperty(HTMLProperty): def plain(self, escape=0): if self._value is None: - return _('[unselected]') + return '' linkcl = self._db.classes[self._prop.classname] k = linkcl.labelprop(1) value = str(linkcl.get(self._value, k)) @@ -807,21 +804,6 @@ class LinkHTMLProperty(HTMLProperty): l.append('') return '\n'.join(l) - def download(self, showid=0): - linkname = self._prop.classname - linkcl = self._db.getclass(linkname) - k = linkcl.labelprop(1) - linkvalue = cgi.escape(str(linkcl.get(self._value, k))) - if showid: - label = value - title = ' title="%s"'%linkvalue - # note ... this should be urllib.quote(linkcl.get(value, k)) - else: - label = linkvalue - title = '' - return '%s'%(linkname, self._value, - linkvalue, title, label) - def menu(self, size=None, height=None, showid=0, additional=[], **conditions): value = self._value @@ -864,7 +846,6 @@ class LinkHTMLProperty(HTMLProperty): l.append(''%(s, optionid, lab)) l.append('') return '\n'.join(l) - # def checklist(self, ...) class MultilinkHTMLProperty(HTMLProperty): diff --git a/roundup/templates/classic/html/issue.item b/roundup/templates/classic/html/issue.item index aacb0e0..2d6d09b 100644 --- a/roundup/templates/classic/html/issue.item +++ b/roundup/templates/classic/html/issue.item @@ -62,7 +62,7 @@ activity info