Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
b5aa5dab
Commit
b5aa5dab
authored
Nov 3, 2022
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
district: Allow copying people
parent
df3d6e6e
No related branches found
No related tags found
2 merge requests
!644
district: Allow copying people
,
!643
district: Allow copying people
Pipeline
#10283
passed
Nov 3, 2022
Stage: build
Changes
1
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
district/models.py
+3
-20
3 additions, 20 deletions
district/models.py
with
3 additions
and
20 deletions
district/models.py
+
3
−
20
View file @
b5aa5dab
...
@@ -21,7 +21,6 @@ from wagtail.admin.edit_handlers import (
...
@@ -21,7 +21,6 @@ from wagtail.admin.edit_handlers import (
PageChooserPanel
,
PageChooserPanel
,
TabbedInterface
,
TabbedInterface
,
)
)
from
wagtail.admin.forms
import
WagtailAdminPageForm
from
wagtail.contrib.routable_page.models
import
RoutablePageMixin
,
route
from
wagtail.contrib.routable_page.models
import
RoutablePageMixin
,
route
from
wagtail.core.fields
import
RichTextField
,
StreamField
from
wagtail.core.fields
import
RichTextField
,
StreamField
from
wagtail.core.models
import
Orderable
,
Page
from
wagtail.core.models
import
Orderable
,
Page
...
@@ -357,7 +356,7 @@ class DistrictArticlePage(
...
@@ -357,7 +356,7 @@ class DistrictArticlePage(
blank
=
True
,
blank
=
True
,
null
=
True
,
null
=
True
,
verbose_name
=
"
náhledový obrázek
"
,
verbose_name
=
"
náhledový obrázek
"
,
related_name
=
"
thumb_image
"
related_name
=
"
thumb_image
"
,
)
)
### PANELS
### PANELS
...
@@ -366,7 +365,7 @@ class DistrictArticlePage(
...
@@ -366,7 +365,7 @@ class DistrictArticlePage(
FieldPanel
(
"
author_page
"
),
FieldPanel
(
"
author_page
"
),
FieldPanel
(
"
is_black
"
),
FieldPanel
(
"
is_black
"
),
FieldPanel
(
"
tags
"
),
FieldPanel
(
"
tags
"
),
FieldPanel
(
"
thumb_image
"
)
FieldPanel
(
"
thumb_image
"
)
,
]
]
promote_panels
=
make_promote_panels
(
promote_panels
=
make_promote_panels
(
...
@@ -578,26 +577,10 @@ class DistrictPersonTag(TaggedItemBase):
...
@@ -578,26 +577,10 @@ class DistrictPersonTag(TaggedItemBase):
)
)
class
DistrictPersonPageForm
(
WagtailAdminPageForm
):
def
clean
(
self
):
cleaned_data
=
super
().
clean
()
email
=
cleaned_data
.
get
(
"
email
"
,
None
)
if
email
:
pages_with_email
=
DistrictPersonPage
.
objects
.
filter
(
email
=
email
)
num_pages_with_email
=
len
(
pages_with_email
)
if
num_pages_with_email
>
1
or
(
num_pages_with_email
==
1
and
pages_with_email
[
0
]
!=
self
.
instance
):
raise
ValidationError
({
"
email
"
:
"
Stránka s tímto emailem již existuje
"
})
return
cleaned_data
class
DistrictPersonPage
(
class
DistrictPersonPage
(
ExtendedMetadataPageMixin
,
SubpageMixin
,
MetadataPageMixin
,
Page
ExtendedMetadataPageMixin
,
SubpageMixin
,
MetadataPageMixin
,
Page
):
):
### FIELDS
### FIELDS
base_form_class
=
DistrictPersonPageForm
job
=
models
.
CharField
(
job
=
models
.
CharField
(
"
Povolání
"
,
"
Povolání
"
,
max_length
=
128
,
max_length
=
128
,
...
@@ -941,7 +924,7 @@ class DistrictElectionCampaignPage(DistrictElectionBasePage):
...
@@ -941,7 +924,7 @@ class DistrictElectionCampaignPage(DistrictElectionBasePage):
show_program_points_inline
=
models
.
BooleanField
(
show_program_points_inline
=
models
.
BooleanField
(
"
Zobrazit obsah programu na jedné stránce
"
,
"
Zobrazit obsah programu na jedné stránce
"
,
default
=
False
,
default
=
False
,
help_text
=
"
Hodí se v případě spousty krátkých bodů programu, z nichž si většina nezaslouží vlastní stránku.
"
help_text
=
"
Hodí se v případě spousty krátkých bodů programu, z nichž si většina nezaslouží vlastní stránku.
"
,
)
)
hero_headline
=
models
.
CharField
(
hero_headline
=
models
.
CharField
(
"
Banner headline
"
,
"
Banner headline
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment