Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3b9457cc
authored
Jun 26, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: allow renotifying if last action not a notification
fixes #177
parent
2a386b8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
circle/vm/models/instance.py
+3
-5
No files found.
circle/vm/models/instance.py
View file @
3b9457cc
...
...
@@ -648,11 +648,9 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
raise
Node
.
DoesNotExist
()
def
_is_notified_about_expiration
(
self
):
renews
=
self
.
activity_log
.
filter
(
activity_code__endswith
=
'renew'
)
cond
=
{
'activity_code__endswith'
:
'notification_about_expiration'
}
if
len
(
renews
)
>
0
:
cond
[
'finished__gt'
]
=
renews
[
0
]
.
started
return
self
.
activity_log
.
filter
(
**
cond
)
.
exists
()
last_activity
=
self
.
activity_log
.
latest
(
'pk'
)
return
(
last_activity
.
activity_code
==
'vm.Instance.notification_about_expiration'
)
def
notify_owners_about_expiration
(
self
,
again
=
False
):
"""Notify owners about vm expiring soon if they aren't already.
...
...
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