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

Use file name numbering on kit upload instead of overwriting files with the same name #1213

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

caitmich
Copy link
Contributor

@caitmich caitmich commented Dec 13, 2023

Summary

When uploading a kit, note/methodology/project templates that have the same file name as an existing template will overwrite the existing one. We don't want templates to be overwritten, but instead want to name them in sequence like we do when a user manually uploads a report template

I assign all rights, including copyright, to any future Dradis
work by myself to Security Roots.

Check List

  • Added a CHANGELOG entry

app/jobs/kit_import_job.rb Outdated Show resolved Hide resolved
Comment on lines +22 to +25
[
template_type,
Pathname.new(Configuration.send("paths_templates_#{template_type}"))
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to 🤓 out, you can do this in a single SQL query, by prebuilding the names from the TEMPLATE_TYPEs.

app/jobs/kit_import_job.rb Outdated Show resolved Hide resolved
app/jobs/kit_import_job.rb Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

None yet

3 participants