Skip to content

Commit 6b8cce5

Browse files
Merge branch 'main' into use-new-message-view
2 parents 953f232 + 63c6c45 commit 6b8cce5

File tree

6 files changed

+41
-17
lines changed

6 files changed

+41
-17
lines changed

poetry.lock

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Generated by Django 3.1.13 on 2021-11-27 12:27
2+
3+
import django.contrib.postgres.fields
4+
from django.db import migrations, models
5+
import pydis_site.apps.api.models.utils
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('api', '0076_merge_20211125_1941'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='botsetting',
17+
name='data',
18+
field=models.JSONField(help_text='The actual settings of this setting.'),
19+
),
20+
migrations.AlterField(
21+
model_name='deletedmessage',
22+
name='embeds',
23+
field=django.contrib.postgres.fields.ArrayField(base_field=models.JSONField(validators=[pydis_site.apps.api.models.utils.validate_embed]), blank=True, help_text='Embeds attached to this message.', size=None),
24+
),
25+
]

pydis_site/apps/api/models/bot/bot_setting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from django.contrib.postgres import fields as pgfields
21
from django.core.exceptions import ValidationError
32
from django.db import models
43

@@ -24,6 +23,6 @@ class BotSetting(ModelReprMixin, models.Model):
2423
max_length=50,
2524
validators=(validate_bot_setting_name,)
2625
)
27-
data = pgfields.JSONField(
26+
data = models.JSONField(
2827
help_text="The actual settings of this setting."
2928
)

pydis_site/apps/api/models/bot/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Message(ModelReprMixin, models.Model):
4848
blank=True
4949
)
5050
embeds = pgfields.ArrayField(
51-
pgfields.JSONField(
51+
models.JSONField(
5252
validators=(validate_embed,)
5353
),
5454
blank=True,

pydis_site/apps/api/models/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@ def validate_embed(embed: Any) -> None:
103103
104104
Example:
105105
106-
>>> from django.contrib.postgres import fields as pgfields
107106
>>> from django.db import models
108107
>>> from pydis_site.apps.api.models.utils import validate_embed
109108
>>> class MyMessage(models.Model):
110-
... embed = pgfields.JSONField(
109+
... embed = models.JSONField(
111110
... validators=(
112111
... validate_embed,
113112
... )

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ license = "MIT"
77

88
[tool.poetry.dependencies]
99
python = "3.9.*"
10-
django = "~=3.0.4"
10+
django = "~=3.1.13"
1111
django-environ = "~=0.4.5"
12-
django-filter = "~=2.1.0"
12+
django-filter = "~=21.1"
1313
djangorestframework = "~=3.11.0"
1414
psycopg2-binary = "~=2.8.0"
1515
django-simple-bulma = "~=2.1"

0 commit comments

Comments
 (0)