Skip to content

Commit aee1394

Browse files
committed
feat: provide instance name through dandischema instance config
instead of a hardcoded value
1 parent b6104d2 commit aee1394

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dandiapi/api/models/version.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55

66
from dandischema.models import AccessType
7+
from dandischema.conf import get_instance_config as get_schema_instance_config
78
from django.conf import settings
89
from django.contrib.postgres.indexes import HashIndex
910
from django.core.validators import RegexValidator
@@ -18,6 +19,7 @@
1819

1920
logger = logging.getLogger(__name__)
2021

22+
_SCHEMA_INSTANCE_CONFIG = get_schema_instance_config()
2123

2224
class Version(PublishableMetadataMixin, TimeStampedModel):
2325
VERSION_REGEX = r'(0\.\d{6}\.\d{4})|draft'
@@ -217,9 +219,9 @@ def _populate_metadata(self):
217219
),
218220
'manifestLocation': manifest_location(self),
219221
'name': self.name,
220-
'identifier': f'DANDI:{self.dandiset.identifier}',
222+
'identifier': f'{_SCHEMA_INSTANCE_CONFIG.instance_name}:{self.dandiset.identifier}',
221223
'version': self.version,
222-
'id': f'DANDI:{self.dandiset.identifier}/{self.version}',
224+
'id': f'{_SCHEMA_INSTANCE_CONFIG.instance_name}:{self.dandiset.identifier}/{self.version}',
223225
'repository': settings.DANDI_WEB_APP_URL,
224226
'url': (
225227
f'{settings.DANDI_WEB_APP_URL}/dandiset/{self.dandiset.identifier}/{self.version}'

0 commit comments

Comments
 (0)