Opened 19 years ago
Closed 19 years ago
#1646 closed defect (fixed)
Attachment date/time shows date/time of server startup
Reported by: | PBruin | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | highest | Milestone: | 0.9 |
Component: | general | Version: | devel |
Severity: | blocker | Keywords: | attachment, wiki |
Cc: | peter.bruin@…, vyt@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When attaching a file to a wiki the date/time shown next to the attachment shows date/time that is related to the last server restart and not the actual upload date/time.
I am using r1768 with mod_python.
Attachments (0)
Change History (8)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
I guess my memory is short. I saw that I reported a simular issue in #1563 that was fixed in [1682]. This made it easy for me to find the problem for this ticket. This patch works for me.
Index: attachment.py =================================================================== --- attachment.py (revision 1768) +++ attachment.py (working copy) @@ -106,20 +106,23 @@ if handle_ta: db.commit() - def insert(self, filename, fileobj, size, time=time.time(), db=None): + def insert(self, filename, fileobj, size, t=None, db=None): if not db: db = self.env.get_db_cnx() handle_ta = True else: handle_ta = False + if t is None: + t = time.time() + # Maximum attachment size (in bytes) max_size = int(self.env.config.get('attachment', 'max_size')) if max_size >= 0 and size > max_size: raise TracError('Maximum attachment size: %d bytes' % max_size, 'Upload failed') self.size = size - self.time = time + self.time = t if not os.access(self.path, os.F_OK): os.makedirs(self.path)
comment:3 by , 19 years ago
Priority: | low → normal |
---|
comment:4 by , 19 years ago
Cc: | added |
---|---|
Component: | wiki → ticket system |
Priority: | normal → highest |
Severity: | normal → blocker |
Peter, thank you very much. I check you patch, it works fine. But only for new attachments… how many attachments with wrong time… grrr
comment:5 by , 19 years ago
Component: | ticket system → general |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:6 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:7 by , 19 years ago
Status: | new → assigned |
---|
Additional info: