Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Feb 1, 2024
1 parent 432dfcb commit 2518768
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 92 deletions.
14 changes: 3 additions & 11 deletions home/export_content_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@
from wagtail.models import Locale, Page # type: ignore
from wagtail.query import PageQuerySet # type: ignore

from home.models import (
ContentPage,
ContentPageIndex,
HomePage,
MessengerBlock,
SMSBlock,
USSDBlock,
VariationBlock,
ViberBlock,
WhatsappBlock,
)
from home.models import (ContentPage, ContentPageIndex, HomePage,
MessengerBlock, SMSBlock, USSDBlock, VariationBlock,
ViberBlock, WhatsappBlock)

HP_CTYPE = HomePage._meta.verbose_name
CP_CTYPE = ContentPage._meta.verbose_name
Expand Down
15 changes: 3 additions & 12 deletions home/import_content_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,9 @@
from wagtail.models.sites import Site # type: ignore
from wagtail.rich_text import RichText # type: ignore

from home.models import (
ContentPage,
ContentPageIndex,
ContentQuickReply,
ContentTrigger,
HomePage,
MessengerBlock,
SMSBlock,
USSDBlock,
ViberBlock,
WhatsappBlock,
)
from home.models import (ContentPage, ContentPageIndex, ContentQuickReply,
ContentTrigger, HomePage, MessengerBlock, SMSBlock,
USSDBlock, ViberBlock, WhatsappBlock)

PageId = tuple[str, Locale]

Expand Down
3 changes: 2 additions & 1 deletion home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from taggit.models import ItemBase, TagBase, TaggedItemBase
from wagtail import blocks
from wagtail.api import APIField
from wagtail.blocks import StreamBlockValidationError, StructBlockValidationError
from wagtail.blocks import (StreamBlockValidationError,
StructBlockValidationError)
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
from wagtail.documents.blocks import DocumentChooserBlock
from wagtail.fields import StreamField
Expand Down
3 changes: 2 additions & 1 deletion home/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from wagtail.models.sites import Site # type: ignore

from home.constants import AGE_CHOICES, GENDER_CHOICES, RELATIONSHIP_STATUS_CHOICES
from home.constants import (AGE_CHOICES, GENDER_CHOICES,
RELATIONSHIP_STATUS_CHOICES)
from home.models import SiteSettings

PFOption = tuple[str, list[str]]
Expand Down
14 changes: 3 additions & 11 deletions home/tests/page_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@
from wagtail.blocks import RichTextBlock, StructBlock # type: ignore
from wagtail.models import Page # type: ignore

from home.models import (
ContentPage,
ContentPageIndex,
ContentQuickReply,
ContentTrigger,
MessengerBlock,
SMSBlock,
USSDBlock,
ViberBlock,
WhatsappBlock,
)
from home.models import (ContentPage, ContentPageIndex, ContentQuickReply,
ContentTrigger, MessengerBlock, SMSBlock, USSDBlock,
ViberBlock, WhatsappBlock)

TPage = TypeVar("TPage", bound=Page)

Expand Down
24 changes: 5 additions & 19 deletions home/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,11 @@
from wagtail import blocks

from home.content_import_export import import_content
from home.models import (
ContentPage,
HomePage,
OrderedContentSet,
PageView,
VariationBlock,
)

from .page_builder import (
MBlk,
MBody,
PageBuilder,
SBlk,
SBody,
UBlk,
UBody,
WABlk,
WABody,
)
from home.models import (ContentPage, HomePage, OrderedContentSet, PageView,
VariationBlock)

from .page_builder import (MBlk, MBody, PageBuilder, SBlk, SBody, UBlk, UBody,
WABlk, WABody)
from .utils import create_page


Expand Down
19 changes: 3 additions & 16 deletions home/tests/test_content_import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,9 @@
from home.models import ContentPage, ContentPageIndex, HomePage

from .helpers import set_profile_field_options
from .page_builder import (
MBlk,
MBody,
NextBtn,
PageBtn,
PageBuilder,
SBlk,
SBody,
UBlk,
UBody,
VarMsg,
VBlk,
VBody,
WABlk,
WABody,
)
from .page_builder import (MBlk, MBody, NextBtn, PageBtn, PageBuilder, SBlk,
SBody, UBlk, UBody, VarMsg, VBlk, VBody, WABlk,
WABody)

ExpDict = dict[str, Any]
ExpPair = tuple[ExpDict, ExpDict]
Expand Down
11 changes: 2 additions & 9 deletions home/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@
from wagtail.blocks import StructBlockValidationError
from wagtail.images import get_image_model

from home.models import (
GoToPageButton,
HomePage,
NextMessageButton,
PageView,
SMSBlock,
USSDBlock,
WhatsappBlock,
)
from home.models import (GoToPageButton, HomePage, NextMessageButton, PageView,
SMSBlock, USSDBlock, WhatsappBlock)

from .page_builder import PageBuilder, WABlk, WABody
from .utils import create_page, create_page_rating
Expand Down
14 changes: 2 additions & 12 deletions home/tests/test_page_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,8 @@
from home.models import ContentPage, ContentPageIndex, HomePage

from .helpers import set_profile_field_options
from .page_builder import (
MBlk,
MBody,
NextBtn,
PageBtn,
PageBuilder,
VarMsg,
VBlk,
VBody,
WABlk,
WABody,
)
from .page_builder import (MBlk, MBody, NextBtn, PageBtn, PageBuilder, VarMsg,
VBlk, VBody, WABlk, WABody)


def unwagtail(val): # type: ignore[no-untyped-def] # No type info
Expand Down

0 comments on commit 2518768

Please sign in to comment.