Skip to content

Commit d9ac960

Browse files
committed
Convert StagingApplication to a proxy model
1 parent 57eb078 commit d9ac960

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 4.2.19 on 2025-04-18 21:19
2+
from __future__ import annotations
3+
4+
from django.db import migrations
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
('oauth2_provider', '0012_add_token_checksum'),
10+
('api', '0021_stagingapplication_allowed_origins_and_more'),
11+
]
12+
13+
operations = [
14+
migrations.DeleteModel(
15+
name='StagingApplication',
16+
),
17+
migrations.CreateModel(
18+
name='StagingApplication',
19+
fields=[],
20+
options={
21+
'proxy': True,
22+
'indexes': [],
23+
'constraints': [],
24+
},
25+
bases=('oauth2_provider.application',),
26+
),
27+
]

dandiapi/api/models/oauth.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
from fnmatch import fnmatch
44

55
from django.core.exceptions import ValidationError
6-
from django.db import models
7-
from oauth2_provider.models import AbstractApplication
6+
from oauth2_provider.models import Application
87

98

10-
class StagingApplication(AbstractApplication):
9+
class StagingApplication(Application):
1110
"""
1211
Custom OAuth Toolkit `Application` model to allow wildcards to be used in redirect URIs.
1312
1413
This is ONLY used in staging; the standard `oauth2_provider.models.Application` is used
1514
in production and local development.
1615
"""
1716

18-
# The default value of `skip_authorization` in `AbstractApplication` is `False`; we
19-
# override that default here for staging.
20-
skip_authorization = models.BooleanField(default=True)
17+
class Meta:
18+
proxy = True
2119

2220
def clean(self):
2321
"""

0 commit comments

Comments
 (0)