1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Note that 'table' is a reserved name for ExportTemplates

This commit is contained in:
Jeremy Stretch
2021-03-29 11:25:22 -04:00
parent 30e4504ee5
commit 93353e94a2
3 changed files with 14 additions and 3 deletions

View File

@@ -261,7 +261,15 @@ class ExportTemplate(BigIDModel):
]
def __str__(self):
return '{}: {}'.format(self.content_type, self.name)
return f"{self.content_type}: {self.name}"
def clean(self):
super().clean()
if self.name.lower() == 'table':
raise ValidationError({
'name': f'"{self.name}" is a reserved name. Please choose a different name.'
})
def render(self, queryset):
"""