Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Michael Coughlin
GraceDB Server
Commits
ab0aff38
Commit
ab0aff38
authored
12 years ago
by
Branson Stephens
Committed by
Branson Stephens
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Working on adding FAR threshold to notifications.
parent
5bc890c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gracedb/alert.py
+6
-1
6 additions, 1 deletion
gracedb/alert.py
userprofile/models.py
+1
-0
1 addition, 0 deletions
userprofile/models.py
userprofile/views.py
+2
-0
2 additions, 0 deletions
userprofile/views.py
with
9 additions
and
1 deletion
gracedb/alert.py
+
6
−
1
View file @
ab0aff38
...
...
@@ -82,7 +82,12 @@ def issueEmailAlert(event, location):
triggers
=
atype
.
trigger_set
.
filter
(
labels
=
None
)
for
trigger
in
triggers
:
for
recip
in
trigger
.
contacts
.
all
():
bccaddresses
.
append
(
recip
.
email
)
if
trigger
.
farThresh
==
None
:
bccaddresses
.
append
(
recip
.
email
)
else
:
if
event
.
far
!=
None
and
event
.
far
<
trigger
.
farThresh
:
bccaddresses
.
append
(
recip
.
email
)
# bccaddresses.append(recip.email)
subject
=
"
[gracedb] %s event. ID: %s
"
%
(
event
.
get_analysisType_display
(),
event
.
graceid
())
message
=
"""
...
...
This diff is collapsed.
Click to expand it.
userprofile/models.py
+
1
−
0
View file @
ab0aff38
...
...
@@ -46,6 +46,7 @@ class Trigger(models.Model):
labels
=
models
.
ManyToManyField
(
Label
,
blank
=
True
)
atypes
=
models
.
ManyToManyField
(
AnalysisType
,
blank
=
True
,
verbose_name
=
"
Analysis Types
"
)
contacts
=
models
.
ManyToManyField
(
Contact
,
blank
=
True
)
farThresh
=
models
.
FloatField
(
blank
=
True
,
null
=
True
)
def
__unicode__
(
self
):
return
(
"
%s: %s
"
)
%
(
...
...
This diff is collapsed.
Click to expand it.
userprofile/views.py
+
2
−
0
View file @
ab0aff38
...
...
@@ -31,6 +31,7 @@ def create(request):
labels
=
form
.
cleaned_data
[
'
labels
'
]
atypes
=
form
.
cleaned_data
[
'
atypes
'
]
contacts
=
form
.
cleaned_data
[
'
contacts
'
]
farThresh
=
form
.
cleaned_data
[
'
farThresh
'
]
if
contacts
and
(
labels
or
atypes
):
t
.
save
()
# Need an id before relations can be set.
...
...
@@ -38,6 +39,7 @@ def create(request):
t
.
labels
=
labels
t
.
atypes
=
atypes
t
.
contacts
=
contacts
t
.
farThresh
=
farThresh
except
:
t
.
delete
()
t
.
save
()
...
...
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