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

Expand Export Template to allow for non-attachment response #5830

Closed
rodvand opened this issue Feb 17, 2021 · 4 comments
Closed

Expand Export Template to allow for non-attachment response #5830

rodvand opened this issue Feb 17, 2021 · 4 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@rodvand
Copy link
Contributor

rodvand commented Feb 17, 2021

Environment

  • Python version: 3.6.8
  • NetBox version: 2.10.4

Proposed Functionality

Add an option to the Export Template functionality where it does not download the export template as an attachment, but instead presents it right away.

Use Case

Allow rendered content to be opened straight away. Currently I am generating a link using the Export Template and am required to open the downloaded attachment and click on the link to access the page. Being able to adjust this behaviour would make for a smoother workflow.

Database Changes

Boolean field on the ExportTemplate model for deciding whether to set the Content-Disposition to attachment. Suggests to set this default as True to keep the current workflow as standard.

External Dependencies

None

On my test instance I commented out the line

response['Content-Disposition'] = 'attachment; filename="{}"'.format(filename)
and this gave me the behaviour I'm describing.

@DanSheps DanSheps added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: feature Introduction of new functionality to the application labels Feb 22, 2021
@rodvand
Copy link
Contributor Author

rodvand commented Feb 23, 2021

I can take a stab at it if you assign it to me.

@jeremystretch
Copy link
Member

I'm assuming this will require the addition of a new boolean field on the ExportTemplate model? In that case, this needs to be wait for a milestone assignment. It's a minor change though, obviously; we can tag it for v2.11.

@rodvand
Copy link
Contributor Author

rodvand commented Mar 30, 2021

Will we manage to get this into 2.11? If needed I can try to work on this.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Mar 30, 2021
@jeremystretch jeremystretch added this to the v2.11 milestone Mar 30, 2021
@jeremystretch
Copy link
Member

@rodvand go for it! I would like to get the v2.11 beta out this week, though, if possible. Let me know if you'd rather me knock it out.

We can either add a boolean field to control the content disposition header, or add it only when a file extension is set.

rodvand added a commit to rodvand/netbox that referenced this issue Mar 30, 2021
jeremystretch added a commit that referenced this issue Mar 30, 2021
#5830: Expand ExportTemplate model with attachment choice
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants