(api) add RELEASE version on config endpoint

Add release version deployed to config endpoint
in order to display release info in La Régie footer.
This commit is contained in:
Sabrina Demagny
2024-10-14 12:23:25 +02:00
parent d635c484ae
commit 017f52a0dc
4 changed files with 5 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ and this project adheres to
### Fixed
- ✨(api) add RELEASE version on config endpoint #459
- 🐛(frontend) fix update accesses form #448
### Added

View File

@@ -506,7 +506,7 @@ class ConfigView(views.APIView):
GET /api/v1.0/config/
Return a dictionary of public settings.
"""
array_settings = ["LANGUAGES", "FEATURES"]
array_settings = ["LANGUAGES", "FEATURES", "RELEASE"]
dict_settings = {}
for setting in array_settings:
dict_settings[setting] = getattr(settings, setting)

View File

@@ -21,6 +21,7 @@ def test_api_config_anonymous():
assert response.json() == {
"LANGUAGES": [["en-us", "English"], ["fr-fr", "French"]],
"FEATURES": {"TEAMS": True},
"RELEASE": "NA",
}
@@ -36,4 +37,5 @@ def test_api_config_authenticated():
assert response.json() == {
"LANGUAGES": [["en-us", "English"], ["fr-fr", "French"]],
"FEATURES": {"TEAMS": True},
"RELEASE": "NA",
}

View File

@@ -23,6 +23,7 @@ test.describe('Config', () => {
['fr-fr', 'French'],
],
FEATURES: { TEAMS: true },
RELEASE: 'NA',
});
});