Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
whats-open
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
whats-open
Commits
db62a200
Commit
db62a200
authored
Oct 03, 2018
by
Ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding URL's, bodies, and subjects to alerts
parent
1a8dda9c
Pipeline
#3081
passed with stage
in 1 minute and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
docker-compose.yml
docker-compose.yml
+3
-2
whats-open/api/models.py
whats-open/api/models.py
+11
-3
No files found.
docker-compose.yml
View file @
db62a200
version
:
"
3"
services
:
db
:
image
:
mysql:5.7
...
...
@@ -10,7 +11,7 @@ services:
mysqld --character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
ports
:
-
"
3306:3306"
-
3306
networks
:
-
wopen_net
environment
:
...
...
@@ -20,7 +21,7 @@ services:
MYSQL_PASSWORD
:
wopen
api
:
image
:
whats-open-api
build
:
.
deploy
:
replicas
:
1
restart_policy
:
...
...
whats-open/api/models.py
View file @
db62a200
...
...
@@ -408,15 +408,21 @@ class Alert(TimeStampedModel):
(
INFO
,
'Info'
),
(
MINOR
,
'Minor'
),
(
MAJOR
,
'Major'
),
(
EMERGENCY
,
'Emergency'
),
(
EMERGENCY
,
'Emergency'
),
)
# The urgency tag for this Alert
urgency_tag
=
models
.
CharField
(
max_length
=
10
,
default
=
'Info'
,
choices
=
URGENCY_CHOICES
)
# The text that is displayed that describes the Alert
message
=
models
.
CharField
(
max_length
=
140
)
subject
=
models
.
CharField
(
max_length
=
130
)
body
=
models
.
TextField
()
url
=
models
.
URLField
(
max_length
=
200
)
# The date + time that the alert will be start being served
start_datetime
=
models
.
DateTimeField
()
...
...
@@ -431,9 +437,11 @@ class Alert(TimeStampedModel):
# Get the current datetime
now
=
timezone
.
now
()
return
self
.
start_datetime
<
now
<
self
.
end_datetime
def
__str__
(
self
):
"""
String representation of an Alert object.
"""
return
"%s"
%
(
self
.
message
)
return
"{0}
\n
{1}
\n
{3}"
.
format
(
self
.
subject
,
self
.
body
,
self
.
url
)
# Returns the subject, body, and url fields
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment