Skip to content

Commit

Permalink
Reordered imports
Browse files Browse the repository at this point in the history
  • Loading branch information
smanga24 committed Dec 4, 2024
1 parent b11d24f commit 5e9181e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/core/panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ def __init__(self, **kwargs):
if self.instance and self.instance.pk:
self.bound_field.field.widget = ReadOnlyPageInput()


class FieldPanel(FieldPanel):
class BoundPanel(FieldPanel.BoundPanel):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if not self.bound_field.field.required:
self.heading += " (optional)"


class InlinePanel(InlinePanel):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions src/country_fact_sheet/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from content.models import ContentPage
from core.panels import FieldPanel


UserModel = get_user_model()


Expand Down
2 changes: 1 addition & 1 deletion src/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from wagtail.contrib.routable_page.models import RoutablePageMixin, route

from content.models import BasePage, ContentPage
from core.panels import FieldPanel
from core.models import fields
from core.panels import FieldPanel
from events import types
from events.utils import get_event_datetime_display_string

Expand Down
2 changes: 1 addition & 1 deletion src/home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from content.models import BasePage, ContentPage
from core.models import fields
from core.models.models import SiteAlertBanner
from core.panels import PageSelectorPanel, FieldPanel, InlinePanel
from core.panels import FieldPanel, InlinePanel, PageSelectorPanel
from events.models import EventPage
from home.forms import HomePageForm
from home.validators import validate_home_priority_pages
Expand Down
3 changes: 1 addition & 2 deletions src/networks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

import peoplefinder.models as pf_models
from content.models import ContentOwnerMixin, ContentPage
from extended_search.index import DWIndexedField as IndexedField

from core.panels import FieldPanel
from extended_search.index import DWIndexedField as IndexedField


class NetworksHome(ContentPage):
Expand Down

0 comments on commit 5e9181e

Please sign in to comment.