Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
15609478
Commit
15609478
authored
3 years ago
by
Bernard Tyers - Sane UX Design
Browse files
Options
Downloads
Patches
Plain Diff
updating l18n strings in models.py
parent
a64e0eff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hypha/public/funds/models.py
+9
-8
9 additions, 8 deletions
hypha/public/funds/models.py
with
9 additions
and
8 deletions
hypha/public/funds/models.py
+
9
−
8
View file @
15609478
...
...
@@ -4,6 +4,7 @@ from django.core.exceptions import ValidationError
from
django.core.paginator
import
EmptyPage
,
PageNotAnInteger
,
Paginator
from
django.db
import
models
from
django.utils.deconstruct
import
deconstructible
from
django.utils.translation
import
gettext
as
_
from
modelcluster.fields
import
ParentalKey
from
pagedown.widgets
import
PagedownWidget
from
wagtail.admin.edit_handlers
import
(
...
...
@@ -148,7 +149,7 @@ class LabPage(BasePage):
related_name
=
'
lab_public
'
,
)
lab_link
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
verbose_name
=
'
External link
'
,
validators
=
[
MailToAndURLValidator
()])
link_text
=
models
.
CharField
(
max_length
=
255
,
help_text
=
'
Text to display on the button for external links
'
,
blank
=
True
)
link_text
=
models
.
CharField
(
max_length
=
255
,
help_text
=
_
(
'
Text to display on the button for external links
'
)
,
blank
=
True
)
body
=
StreamField
(
LabBlock
())
search_fields
=
BasePage
.
search_fields
+
[
...
...
@@ -165,7 +166,7 @@ class LabPage(BasePage):
FieldPanel
(
'
lab_link
'
),
FieldPanel
(
'
link_text
'
),
]),
],
heading
=
'
Link for lab application
'
),
],
heading
=
_
(
'
Link for lab application
'
)
)
,
StreamFieldPanel
(
'
body
'
),
InlinePanel
(
'
related_pages
'
,
label
=
"
Related pages
"
),
]
...
...
@@ -187,24 +188,24 @@ class LabPage(BasePage):
def
clean
(
self
):
if
self
.
lab_type
and
self
.
lab_link
:
raise
ValidationError
({
'
lab_type
'
:
'
Cannot link to both a Lab page and external link
'
,
'
lab_link
'
:
'
Cannot link to both a Lab page and external link
'
,
'
lab_type
'
:
_
(
'
Cannot link to both a Lab page and external link
'
)
,
'
lab_link
'
:
_
(
'
Cannot link to both a Lab page and external link
'
)
,
})
if
not
self
.
lab_type
and
not
self
.
lab_link
:
raise
ValidationError
({
'
lab_type
'
:
'
Please provide a way for applicants to apply
'
,
'
lab_link
'
:
'
Please provide a way for applicants to apply
'
,
'
lab_type
'
:
_
(
'
Please provide a way for applicants to apply
'
)
,
'
lab_link
'
:
_
(
'
Please provide a way for applicants to apply
'
)
,
})
if
self
.
lab_type
and
self
.
link_text
:
raise
ValidationError
({
'
link_text
'
:
'
Cannot customise the text for internal lab pages, leave blank
'
,
'
link_text
'
:
_
(
'
Cannot customise the text for internal lab pages, leave blank
'
)
,
})
if
self
.
lab_link
and
not
self
.
link_text
:
raise
ValidationError
({
'
link_text
'
:
'
Please provide some text for the link button
'
,
'
link_text
'
:
_
(
'
Please provide some text for the link button
'
)
,
})
...
...
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