From 85670af2eafec34065f5f77dcc0e3d8b2859971e Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 18 Sep 2024 12:47:17 +0200 Subject: [PATCH] feat(userlog): use fixed deprovision date format Signed-off-by: jkoberg --- changelog/unreleased/format-deprovision-date.md | 5 +++++ services/userlog/pkg/service/conversion.go | 2 +- services/userlog/pkg/service/service.go | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/format-deprovision-date.md diff --git a/changelog/unreleased/format-deprovision-date.md b/changelog/unreleased/format-deprovision-date.md new file mode 100644 index 00000000000..51ddcb967c2 --- /dev/null +++ b/changelog/unreleased/format-deprovision-date.md @@ -0,0 +1,5 @@ +Enhancement: Format deprovision date + +The date in the deprovision message should apparently be RFC3339 formatted and not configurable. + +https://github.com/owncloud/ocis/pull/10100 diff --git a/services/userlog/pkg/service/conversion.go b/services/userlog/pkg/service/conversion.go index f60f30cc801..c54bb0138ff 100644 --- a/services/userlog/pkg/service/conversion.go +++ b/services/userlog/pkg/service/conversion.go @@ -129,7 +129,7 @@ func (c *Converter) ConvertGlobalEvent(typ string, data json.RawMessage) (OC10No return OC10Notification{}, err } - return c.deprovisionMessage(PlatformDeprovision, dd.DeprovisionDate.Format(dd.DeprovisionFormat)) + return c.deprovisionMessage(PlatformDeprovision, dd.DeprovisionDate.Format(time.RFC3339)) } } diff --git a/services/userlog/pkg/service/service.go b/services/userlog/pkg/service/service.go index f18e4c18c6b..7272e5874cd 100644 --- a/services/userlog/pkg/service/service.go +++ b/services/userlog/pkg/service/service.go @@ -283,7 +283,6 @@ func (ul *UserlogService) StoreGlobalEvent(ctx context.Context, typ string, data date, err := time.Parse(format, dps) if err != nil { - fmt.Println("", format, "\n", dps) return fmt.Errorf("cannot parse time to format. time: '%s' format: '%s'", dps, format) }