Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcms.rpc.api.user.add_attachment return URL that doesn't work #3350

Open
gurkirat1632 opened this issue Sep 14, 2023 · 1 comment
Open

tcms.rpc.api.user.add_attachment return URL that doesn't work #3350

gurkirat1632 opened this issue Sep 14, 2023 · 1 comment

Comments

@gurkirat1632
Copy link

gurkirat1632 commented Sep 14, 2023

Using

tcms.rpc.api.user.add_attachment(filename, b64content, **kwargs)[source]
RPC User.add_attachment(filename, b64content)

returns URL and file name. But when try to open the URL it's displaying 404 page not found

Used (https://public.tenant.kiwitcms.org/)

Steps to Reproduce

  1. Try to upload an PNG image using user.add_attachment
  2. Getting response in proper dictionary with URL and file name.
  3. Now try to open the URL in browser when logged in with same user.

Actual results

Dictionary results are:
url is :/uploads/attachments/auth_user/15355/TestCheckAttgu.png
file is LTestCheckAttgu.png

image

Expected results

404 not found should not be shown

Additional info (Python traceback, logs, etc.)

@atodorov
Copy link
Member

Steps to Reproduce

1. Try to upload an PNG image using user.add_attachment
2. Getting response in proper dictionary with URL and file name.
3. Now try to open the URL in browser when logged in with same user.

I tried but couldn't reproduce. The file was still accessible afterwards.

Can you post the exact version of the tcms-api package you are using and more detailed steps to reproduce.

Actual results

Dictionary results are: url is :/uploads/attachments/auth_user/15355/TestCheckAttgu.png file is LTestCheckAttgu.png

This isn't a dictionary and your filename LTestCheckAttgu.png doesn't math the resulting URL. Can you post the actual dictionary returned from the Python library to avoid any mismatches or typos ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants