Mercurial > gemma
changeset 5329:795a0a0b5047 extented-report
Embed scheduling type into report import to ensure persistence of schedule data.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 31 May 2021 10:10:31 +0200 |
parents | bc8c082487b2 |
children | b1b9b384540d |
files | pkg/imports/report.go |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/imports/report.go Sun May 30 19:53:04 2021 +0200 +++ b/pkg/imports/report.go Mon May 31 10:10:31 2021 +0200 @@ -19,9 +19,11 @@ "errors" "gemma.intevation.de/gemma/pkg/common" + "gemma.intevation.de/gemma/pkg/models" ) type Report struct { + models.QueueConfigurationType Name string `json:"Name"` } @@ -48,11 +50,17 @@ func (*Report) CleanUp() error { return nil } func (r *Report) MarshalAttributes(attrs common.Attributes) error { + if err := r.QueueConfigurationType.MarshalAttributes(attrs); err != nil { + return err + } attrs.Set("name", r.Name) return nil } func (r *Report) UnmarshalAttributes(attrs common.Attributes) error { + if err := r.QueueConfigurationType.UnmarshalAttributes(attrs); err != nil { + return err + } name, found := attrs.Get("name") if !found { return errors.New("missing 'name' attribute")