Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-03-06 00:37:37 +0300
committerStan Hu <stanhu@gmail.com>2018-03-06 00:38:46 +0300
commit2d1ceca077a1624a4bdc6aa26ab8a5113a5f6394 (patch)
treee21b0fcb85052959a673114b0691f5f7233854fc /app/services
parent8a0052c037f025b64159ca8cfe0d3451261c1edb (diff)
Don't error out in system hook if user has `nil` datetime columns
Deleting a user would fail in the system hooks if the user had `nil` column in `datetime` or `updated_at` fields. Closes #43871
Diffstat (limited to 'app/services')
-rw-r--r--app/services/system_hooks_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb
index af8c02a10b7..ba7946fd23c 100644
--- a/app/services/system_hooks_service.rb
+++ b/app/services/system_hooks_service.rb
@@ -20,8 +20,8 @@ class SystemHooksService
def build_event_data(model, event)
data = {
event_name: build_event_name(model, event),
- created_at: model.created_at.xmlschema,
- updated_at: model.updated_at.xmlschema
+ created_at: model.created_at&.xmlschema,
+ updated_at: model.updated_at&.xmlschema
}
case model