parent
d2a1fd7f3a
commit
4496972205
3 changed files with 336 additions and 273 deletions
595
poetry.lock
generated
595
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -24,10 +24,13 @@ psycopg2-binary = "^2.8.5"
|
||||||
gunicorn = "^20.0.4"
|
gunicorn = "^20.0.4"
|
||||||
python-dotenv = "^0.12.0"
|
python-dotenv = "^0.12.0"
|
||||||
django = ">=3.0.7"
|
django = ">=3.0.7"
|
||||||
sentry-sdk = "^0.15.1"
|
sentry-sdk = {version = "^0.15.1", optional = true}
|
||||||
ftfy = "^5.8"
|
ftfy = "^5.8"
|
||||||
requests_oauthlib = "^1.3.0"
|
requests_oauthlib = "^1.3.0"
|
||||||
|
|
||||||
|
[tool.poetry.extras]
|
||||||
|
sentry = ["sentry_sdk"]
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
factory-boy = "^2.12.0"
|
factory-boy = "^2.12.0"
|
||||||
freezegun = "^0.3.15"
|
freezegun = "^0.3.15"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,14 @@ class RulesWidget(CheckboxSelectMultiple):
|
||||||
|
|
||||||
def create_option(self, *args, **kwargs):
|
def create_option(self, *args, **kwargs):
|
||||||
option = super().create_option(*args, **kwargs)
|
option = super().create_option(*args, **kwargs)
|
||||||
instance = self.choices.queryset.get(pk=option["value"])
|
|
||||||
|
# see https://docs.djangoproject.com/en/3.1/releases/3.1/#id1
|
||||||
|
try:
|
||||||
|
pk = int(option["value"])
|
||||||
|
except TypeError:
|
||||||
|
pk = option["value"].value
|
||||||
|
|
||||||
|
instance = self.choices.queryset.get(pk=pk)
|
||||||
|
|
||||||
if self.category and instance.category:
|
if self.category and instance.category:
|
||||||
option["selected"] = self.category.pk == instance.category.pk
|
option["selected"] = self.category.pk == instance.category.pk
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue