#9579 closed defect (fixed)
trac-admin add is broken
| Reported by: | Owned by: | Radek Bartoň | |
|---|---|---|---|
| Priority: | normal | Component: | DownloadsPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.12 |
Description (last modified by )
Hello,
Trying to add file using trac-admin:
trac-admin /var/trac/my_trac/ download add my_file.php.zip description="Latest version of my_file"
I got the following error:
AttributeError: 'DownloadsApi' object has no attribute 'store_download'
I fixed it by replacing:
api.store_download(context, download, file)
with
api._add_download( context, download, file)
in consoleadmin.py
Rgds
Attachments (0)
Change History (5)
comment:1 Changed 14 years ago by
| Description: | modified (diff) |
|---|
comment:2 follow-up: 3 Changed 14 years ago by
comment:3 Changed 14 years ago by
Replying to rjollos:
I've only briefly look at the source code, but there is also
api.add_download. By typical convention,api._add_downloadis probably an internal class method, so it seems likely we should be usingapi.add_download.
_add_download is used in the methods called by process_request, so it seems fairly certain it is the right method to call in consoleadmin.
This is a really simple change that will fix a major defect, so I hope the plugin author will be okay if I just go ahead and commit it to the database. I will follow up quickly and remedy the situation if I'm doing something wrong here.
comment:4 Changed 14 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |



I've only briefly look at the source code, but there is also
api.add_download. By typical convention,api._add_downloadis probably an internal class method, so it seems likely we should be usingapi.add_download.