Revision fb67376a flowspec/models.py
b/flowspec/models.py | ||
---|---|---|
312 | 312 |
except: |
313 | 313 |
applier_peer = None |
314 | 314 |
return applier_peer |
315 |
|
|
316 |
@property |
|
317 |
def days_to_expire(self): |
|
318 |
if self.status not in ['EXPIRED', 'ADMININACTIVE', 'ERROR']: |
|
319 |
expiration_days = (self.expires - datetime.date.today()).days |
|
320 |
if expiration_days < settings.EXPIRATION_NOTIFY_DAYS: |
|
321 |
return expiration_days |
|
322 |
else: |
|
323 |
return False |
|
324 |
else: |
|
325 |
return False |
|
315 | 326 |
|
316 | 327 |
def send_message(msg, user): |
317 | 328 |
# username = user.username |
Also available in: Unified diff