Why does django override css variable name from db? [closed]
I'm taking over a django+react project from a guy who left the company, but this is the first time I work with django so I'm somewhat clueless.
The project is a status management page with calendar and stuff (sqlite3 as db). Possible statuses (like In Office, or Sick Leave) and their corresponding data is stored in db, including color for the status. The color was previously stored as a css hex string without the # (got prepended later by code).
But the color values are used at multiple places, so they were copy-pasted many times. Since the colors might change, I wanted to get them all together, so I created css variables like '--in-office-color: rgb(whatever)', and changed db to contain the strings 'var(--in-office-color)' and so instead.
Now when I want to return it in a view like this:
class SomeView(APIView):
def get(self, request):
//...
data = { /* other profile data here */ "statuses": {i.id: {"name":i.name, "color": i.color} for i in Statuses.objects.all()}
}
return Response(data)
Then in the response some css variables are ok, and some got changed. The two problematic ones are "--in-office-color" which changes to "--in.office-color" and "--home-office-color" also changed to "--home.office-color" (whilst "--out-of-office-color" remains unchanged for example)
I suspect that some string escape or protected word mechanism filters the database output, but I could not find any settings file or module that could give an explanation.
Have you seen something like this? Any ideas what could override the sting content, and how to solve it?