Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Hjelp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Hjelp
Commits
8e997e0e
Commit
8e997e0e
authored
4 years ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Check whether admin email is present, if not use empty default
parent
013bf87e
No related branches found
No related tags found
1 merge request
!16
Resolve "Add empty default mail if no admins are available"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/hjelp/preferences.py
+13
-4
13 additions, 4 deletions
aleksis/apps/hjelp/preferences.py
with
13 additions
and
4 deletions
aleksis/apps/hjelp/preferences.py
+
13
−
4
View file @
8e997e0e
from
django
import
forms
from
django.conf
import
settings
from
django.utils.translation
import
gettext_lazy
as
_
from
dynamic_preferences.types
import
StringPreference
from
dynamic_preferences.preferences
import
Section
from
aleksis.core.registries
import
site_preferences_registry
from
aleksis.core.settings
import
ADMINS
as
admins
hjelp
=
Section
(
"
hjelp
"
)
...
...
@@ -16,7 +16,10 @@ class FAQRecipient(StringPreference):
field_class
=
forms
.
EmailField
section
=
hjelp
name
=
"
faq_recipient
"
default
=
admins
[
0
].
email
if
settings
.
ADMINS
[
0
].
email
:
default
=
settings
.
ADMINS
[
0
].
email
else
:
default
=
""
required
=
False
verbose_name
=
_
(
"
Recipient e-mail address for FAQ questions
"
)
...
...
@@ -26,7 +29,10 @@ class IssueReportRecipient(StringPreference):
field_class
=
forms
.
EmailField
section
=
hjelp
name
=
"
issue_report_recipient
"
default
=
admins
[
0
].
email
if
settings
.
ADMINS
[
0
].
email
:
default
=
settings
.
ADMINS
[
0
].
email
else
:
default
=
""
required
=
False
verbose_name
=
_
(
"
Recipient e-mail address for issue reports
"
)
...
...
@@ -36,6 +42,9 @@ class FeedbackRecipient(StringPreference):
field_class
=
forms
.
EmailField
section
=
hjelp
name
=
"
feedback_recipient
"
default
=
admins
[
0
].
email
if
settings
.
ADMINS
[
0
].
email
:
default
=
settings
.
ADMINS
[
0
].
email
else
:
default
=
""
required
=
False
verbose_name
=
_
(
"
Recipient e-mail address for feedback
"
)
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