From 9e41a8e03ab3c3da3a8e17ea30dabc1533ca0369 Mon Sep 17 00:00:00 2001 From: Tim Scheuermann Date: Tue, 23 Jul 2019 18:44:59 +0200 Subject: [PATCH] MM-12460 Fill the Theme field for team members on export (#11533) * Fill the Theme field for team members on export * Reverted renaming userId to userID * Use the TeamId to get the team specific theme --- app/export.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/export.go b/app/export.go index b25abef801..907d50df30 100644 --- a/app/export.go +++ b/app/export.go @@ -17,7 +17,7 @@ import ( ) // We use this map to identify the exportable preferences. -// Here we link the preference category and name, to the name of the relevant filed in the import struct. +// Here we link the preference category and name, to the name of the relevant field in the import struct. var exportablePreferences = map[ComparablePreference]string{{ Category: model.PREFERENCE_CATEGORY_THEME, Name: "", @@ -270,6 +270,12 @@ func (a *App) buildUserTeamAndChannelMemberships(userId string) (*[]UserTeamImpo return nil, err } + // Get the user theme + themePreference, err := a.Srv.Store.Preference().Get(member.UserId, model.PREFERENCE_CATEGORY_THEME, member.TeamId) + if err == nil { + memberData.Theme = &themePreference.Value + } + memberData.Channels = channelMembers memberships = append(memberships, *memberData)