Skip to content

Commit 891dbf4

Browse files
committed
Add default value
1 parent be5495f commit 891dbf4

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

readthedocs/api/v2/views/integrations.py

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ def get_integration(self):
159159
integration = Integration.objects.create(
160160
project=self.project,
161161
integration_type=self.integration_type,
162-
provider_data={},
163162
# If we didn't create the integration,
164163
# we didn't set a secret.
165164
secret=None,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.27 on 2020-02-17 18:14
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations
6+
import jsonfield.fields
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('integrations', '0005_change_default_integration_secret'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='integration',
18+
name='provider_data',
19+
field=jsonfield.fields.JSONField(default=dict, verbose_name='Provider data'),
20+
),
21+
]

readthedocs/integrations/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class Integration(models.Model):
252252
max_length=32,
253253
choices=INTEGRATIONS,
254254
)
255-
provider_data = JSONField(_('Provider data'))
255+
provider_data = JSONField(_('Provider data'), default=dict)
256256
exchanges = GenericRelation(
257257
'HttpExchange',
258258
related_query_name='integrations',

0 commit comments

Comments
 (0)