Skip to content

Commit bc1604c

Browse files
authored
Merge pull request #72 from gasman/wagtail-6.3
Wagtail 6.3 support
2 parents b0f5875 + 589fd9e commit bc1604c

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
11+
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1212

1313
steps:
1414
- uses: actions/checkout@v3

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.8.0 (xx.xx.xxxx)
4+
5+
* Add support for Wagtail 6.1 - 6.3 (Matt Westcott)
6+
* Update testing to include Python 3.13, Django 5.1 (Matt Westcott)
7+
* Drop support for Python 3.8 (Matt Westcott)
8+
39
## 0.7.0 (06.02.2024)
410

511
* Add support for Wagtail 5.2 (Josh Munn)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ classifiers=[
1616
"Operating System :: OS Independent",
1717
"Programming Language :: Python",
1818
"Programming Language :: Python :: 3",
19-
"Programming Language :: Python :: 3.8",
2019
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
2221
"Programming Language :: Python :: 3.11",
2322
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
2424
"Framework :: Django",
2525
"Framework :: Django :: 4",
2626
"Framework :: Django :: 5.0",
27+
"Framework :: Django :: 5.1",
2728
"Framework :: Wagtail",
2829
"Framework :: Wagtail :: 5",
2930
"Framework :: Wagtail :: 6",

tox.ini

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
[tox]
22
envlist =
3-
python{3.8,3.9,3.10,3.11,3.12}-django{4.2,5.0}-wagtail{5.2,6.0}
3+
python{3.9,3.10,3.11,3.12,3.13}-django{4.2,5.0,5.1}-wagtail{5.2,6.0,6.1,6.2,6.3}
44

55
[testenv]
66
commands = python runtests.py
77

88
basepython =
9-
python3.8: python3.8
109
python3.9: python3.9
1110
python3.10: python3.10
1211
python3.11: python3.11
1312
python3.12: python3.12
13+
python3.13: python3.13
1414

1515
deps =
1616
django4.2: Django>=4.2,<5.0
1717
django5.0: Django>=5.0,<5.1
18+
django5.0: Django>=5.1,<5.2
1819
wagtail5.2: wagtail>=5.2,<6.0
19-
wagtail6.0: wagtail>=6.0rc1,<6.1
20+
wagtail6.0: wagtail>=6.0,<6.1
21+
wagtail6.1: wagtail>=6.1,<6.2
22+
wagtail6.2: wagtail>=6.2,<6.3
23+
wagtail6.3: wagtail>=6.3,<6.4

wagtail_airtable/mixins.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from airtable import Airtable
66
from django.conf import settings
77
from django.db import models
8+
from django.middleware.csrf import get_token
89
from django.urls import reverse
910
from django.utils.functional import cached_property
1011
from requests import HTTPError
@@ -369,11 +370,16 @@ class Meta:
369370
class ImportButton(Button):
370371
template_name = "wagtail_airtable/_import_button.html"
371372

373+
def __init__(self, *args, request=None, model_opts = None, **kwargs):
374+
super().__init__(*args, **kwargs)
375+
self.request = request
376+
self.model_opts = model_opts
377+
372378
def get_context_data(self, parent_context):
373379
context = super().get_context_data(parent_context)
374-
context["csrf_token"] = parent_context["csrf_token"]
375-
context["model_opts"] = parent_context["model_opts"]
376-
context["next"] = parent_context["request"].path
380+
context["csrf_token"] = get_token(self.request)
381+
context["model_opts"] = self.model_opts
382+
context["next"] = self.request.path
377383
return context
378384

379385

@@ -386,7 +392,9 @@ def header_buttons(self):
386392
buttons.append(
387393
ImportButton(
388394
"Import from Airtable",
389-
url=reverse("airtable_import_listing")
395+
url=reverse("airtable_import_listing"),
396+
request=self.request,
397+
model_opts=self.model and self.model._meta,
390398
)
391399
)
392400
return buttons

0 commit comments

Comments
 (0)