Provide background color when first checking API session
This commit is contained in:
parent
0715bd6321
commit
d256e2014a
|
@ -57,7 +57,16 @@ class AuthenticationView(APIView):
|
||||||
if self.request.user:
|
if self.request.user:
|
||||||
data = self.user_info(self.request.user)
|
data = self.user_info(self.request.user)
|
||||||
data['user']['is_root'] = self.request.is_root
|
data['user']['is_root'] = self.request.is_root
|
||||||
|
|
||||||
data['permissions'] = list(self.request.tailbone_cached_permissions)
|
data['permissions'] = list(self.request.tailbone_cached_permissions)
|
||||||
|
|
||||||
|
# background color may be set per-request, by some apps
|
||||||
|
if hasattr(self.request, 'background_color') and self.request.background_color:
|
||||||
|
data['background_color'] = self.request.background_color
|
||||||
|
else: # otherwise we use the one from config
|
||||||
|
data['background_color'] = self.rattail_config.get(
|
||||||
|
'tailbone', 'background_color')
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@api
|
@api
|
||||||
|
|
Loading…
Reference in a new issue