Skip to content

Commit

Permalink
[#2076] Upgrade django-admin-index and django-ordered-model
Browse files Browse the repository at this point in the history
  • Loading branch information
pi-sigma committed Feb 7, 2024
1 parent 562c0e2 commit 376238b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 13 deletions.
5 changes: 3 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ diff-match-patch==20200713
django==3.2.23
# via
# -r requirements/base.in
# django-admin-index
# django-appconf
# django-appdata
# django-axes
Expand Down Expand Up @@ -124,7 +125,7 @@ django==3.2.23
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
django-admin-index==1.5.0
django-admin-index==3.1.0
# via -r requirements/base.in
django-appconf==1.0.5
# via
Expand Down Expand Up @@ -200,7 +201,7 @@ django-log-outgoing-requests==0.6.0
# via -r requirements/base.in
django-open-forms-client==0.2.3
# via -r requirements/base.in
django-ordered-model==3.4.3
django-ordered-model==3.7.4
# via
# -r requirements/base.in
# django-admin-index
Expand Down
5 changes: 3 additions & 2 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ django==3.2.23
# via
# -c requirements/base.txt
# -r requirements/base.txt
# django-admin-index
# django-appconf
# django-appdata
# django-axes
Expand Down Expand Up @@ -196,7 +197,7 @@ django==3.2.23
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
django-admin-index==1.5.0
django-admin-index==3.1.0
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down Expand Up @@ -330,7 +331,7 @@ django-open-forms-client==0.2.3
# via
# -c requirements/base.txt
# -r requirements/base.txt
django-ordered-model==3.4.3
django-ordered-model==3.7.4
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down
5 changes: 3 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ django==3.2.23
# -c requirements/ci.txt
# -r requirements/ci.txt
# ddt-api-calls
# django-admin-index
# django-appconf
# django-appdata
# django-axes
Expand Down Expand Up @@ -231,7 +232,7 @@ django==3.2.23
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
django-admin-index==1.5.0
django-admin-index==3.1.0
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -369,7 +370,7 @@ django-open-forms-client==0.2.3
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
django-ordered-model==3.4.3
django-ordered-model==3.7.4
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
TWO_FACTOR_WEBAUTHN_AUTHENTICATOR_ATTACHMENT = "cross-platform"
# Allow OIDC admins to bypass 2FA
MAYKIN_2FA_ALLOW_MFA_BYPASS_BACKENDS = [
"open_inwoner.accounts.backends.CustomOIDCBackend",
# "open_inwoner.accounts.backends.CustomOIDCBackend",
]

# file upload limits
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 3.2.23 on 2024-02-07 15:19

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("configurations", "0058_siteconfiguration_recipients_email_digest"),
]

operations = [
migrations.AlterModelOptions(
name="siteconfigurationpage",
options={
"ordering": ("order",),
"verbose_name": "Flatpage in the footer",
"verbose_name_plural": "Flatpages in the footer",
},
),
]
2 changes: 1 addition & 1 deletion src/open_inwoner/configurations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class SiteConfigurationPage(OrderedModel):

objects = OrderedModelManager()

class Meta:
class Meta(OrderedModel.Meta):
verbose_name = _("Flatpage in the footer")
verbose_name_plural = _("Flatpages in the footer")

Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/pdc/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class ProductCondition(OrderedModel):
help_text=_("Rule for the automated check"),
)

class Meta:
class Meta(OrderedModel.Meta):
verbose_name = _("Condition")
verbose_name_plural = _("Conditions")
ordering = ("order",)
Expand Down
4 changes: 0 additions & 4 deletions src/open_inwoner/utils/django_two_factor_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@
def should_display_dropdown_menu(request) -> bool:
default = default_should_display_dropdown_menu(request)

# never display the dropdown in two-factor admin views
if request.resolver_match.view_name.startswith("maykin_2fa"):
return False

return default and request.user.is_verified()

0 comments on commit 376238b

Please sign in to comment.