Skip to content

Commit dbebda5

Browse files
committed
feat: provide instance name through dandischema instance config
instead of a hardcoded value
1 parent 7ad36cb commit dbebda5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dandiapi/api/views/dandiset.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import TYPE_CHECKING
55

66
from allauth.socialaccount.models import SocialAccount
7+
from django.conf import settings
78
from django.contrib.auth.models import User
89
from django.contrib.postgres.lookups import Unaccent
910
from django.db import transaction
@@ -425,7 +426,9 @@ def create(self, request: Request):
425426
identifier = None
426427
if 'identifier' in serializer.validated_data['metadata']:
427428
identifier = serializer.validated_data['metadata']['identifier']
428-
identifier = identifier.removeprefix('DANDI:')
429+
identifier = identifier.removeprefix(
430+
f'{settings.DANDI_SCHEMA_INSTANCE_CONFIG.instance_name}:'
431+
)
429432

430433
try:
431434
identifier = int(identifier)

0 commit comments

Comments
 (0)