# Template with invalid chars can be created but not modified or deleted

**URL:** <https://drone.discourse.group/t/template-with-invalid-chars-can-be-created-but-not-modified-or-deleted/12584>\
**Category:** Drone Bugs\
**Created:** [October 5, 2022, 1:08pm UTC](https://drone.discourse.group/t/template-with-invalid-chars-can-be-created-but-not-modified-or-deleted/12584 "2022-10-05T13:08:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OCram85](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ocram85/32/2980_2.png) [@OCram85](https://drone.discourse.group/u/OCram85)\
**Post date:** [October 5, 2022, 1:08pm UTC](https://drone.discourse.group/t/template-with-invalid-chars-can-be-created-but-not-modified-or-deleted/12584/1 "2022-10-05T13:08:36Z")

</div>

Just noticed the template name is unique.

So I tried to add the organization into the template name with this pattern: `ORG/template-name.yaml`. Additionally I tried to add a gitea template variable string within drone template name.

Unfortunately this broke my sqlite 😉 … These templates can not be edited or remove with the drone ui + drone cli:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/f/fcd7ced6688542d628f8032326aa6208585d2ecd.png)

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/1/12394972c9fc0d925b27521600f0b3bc8a5fc963.png)

To explain the `templates` hell here:

- There is a Gitea organization named `Templates`
- I tried to add the organization name as prefix for a drone template as workaround for the unique names: `<Organization>/<Name>.yaml`

* * *

📓 Additional Notes

- 📌 It seems like the problem here is the `/`. It gets interpreted as part of the path for the API call. Maybe it’s worth adding a regex validation for the template name input field to avoid this?
- 📌 Is it save to delete the template items with a sqlite command like `DELETE FROM templates WHERE id = 999` ?

---

<div class="post-metadata">

**Author:** ![d1wilko](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/d1wilko/32/6474_2.png) [@d1wilko](https://drone.discourse.group/u/d1wilko)\
**Post date:** [October 26, 2022, 1:00pm UTC](https://drone.discourse.group/t/template-with-invalid-chars-can-be-created-but-not-modified-or-deleted/12584/2 "2022-10-26T13:00:11Z")

</div>

Hi @OCram85 apologies for the delay in reply.

Yeah that is a bug - bit of an edge case but a bug none the less. - I’ll raise a ticket but can’t promise a turnaround time.

feel free to delete it from the db as you suggest - I wouldn’t expect any issues to arise
