Commit 00fb053f authored by ale's avatar ale
Browse files

Ensure that new resources have their Type set

parent da871e97
...@@ -778,7 +778,10 @@ func (c *templateContext) databaseResourceTemplate(ctx context.Context, r *Resou ...@@ -778,7 +778,10 @@ func (c *templateContext) databaseResourceTemplate(ctx context.Context, r *Resou
} }
func (c *templateContext) applyTemplate(ctx context.Context, r *Resource, user *User) { func (c *templateContext) applyTemplate(ctx context.Context, r *Resource, user *User) {
switch r.ID.Type() { // Ensure that the Type attribute always matches ID.Type().
r.Type = r.ID.Type()
switch r.Type {
case ResourceTypeEmail: case ResourceTypeEmail:
c.emailResourceTemplate(ctx, r, user) c.emailResourceTemplate(ctx, r, user)
case ResourceTypeWebsite, ResourceTypeDomain: case ResourceTypeWebsite, ResourceTypeDomain:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment