@@ -27,21 +27,15 @@ def create(self, validated_data):
2727 test_data_sample_keys = validated_data .get ('test_data_sample_keys' , [])
2828
2929 # TODO, create a datamigration with new Site domain name when we will know the name of the final website
30- host = ''
31- protocol = 'http://'
32- request = self .context .get ('request' , None )
33-
34- if request :
35- protocol = 'https://' if request .is_secure () else 'http://'
36- host = request .get_host ()
30+ current_site = getattr (settings , "DEFAULT_DOMAIN" )
3731
3832 args = {
3933 'name' : name ,
4034 'descriptionHash' : get_hash (instance .description ),
41- 'descriptionStorageAddress' : protocol + host + reverse ('substrapp:objective-description' , args = [instance .pk ]), # noqa
35+ 'descriptionStorageAddress' : current_site + reverse ('substrapp:objective-description' , args = [instance .pk ]), # noqa
4236 'metricsName' : metrics_name ,
4337 'metricsHash' : get_hash (instance .metrics ),
44- 'metricsStorageAddress' : protocol + host + reverse ('substrapp:objective-metrics' , args = [instance .pk ]),
38+ 'metricsStorageAddress' : current_site + reverse ('substrapp:objective-metrics' , args = [instance .pk ]),
4539 'testDataset' : {
4640 'dataManagerKey' : test_data_manager_key ,
4741 'dataSampleKeys' : test_data_sample_keys ,
0 commit comments