Permalink
Browse files

Hotfix/1.6.6 (#574)

* broke out dockerfile to determine where it is failing

* add extra repositories for apk and add openssl-dev build dependency

* use libressl instead of openssl

* removed cryptography from requirements

* update changelog

* remove _add_data from alert save method

* update CHANGELOG

* change conditional to check for None data instead of falsy

* add alert data collection toggle

* add conditional operator in case ALERTS settings isn't present

* add conditional to check if settings object has ALERTS attribute

* update CHANGELOG
  • Loading branch information...
chasebrewsky committed Jun 14, 2018
1 parent 7731deb commit 94fe98fb72a884d053039936e9197f72d4ddbb82
Showing with 25 additions and 0 deletions.
  1. +7 −0 CHANGELOG.md
  2. +5 −0 cyphon/alerts/models.py
  3. +8 −0 cyphon/alerts/tests/test_models.py
  4. +5 −0 cyphon/cyphon/settings/conf.example.py
View
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/). This project adheres to [Semantic Versioning](http://semver.org/).
<a name="1.6.6"></a>
## [1.6.6](https://github.com/dunbarcyber/cyphon/compare/1.6.5...1.6.6) (2018-06-14)
### Changed
- **alerts.models** + **cyphon.settings.conf**: added conditional setting ALERTS.DISABLE_COLLECTION_SEARCH to determine if alert should search backend storage for missing alert data. ([09c246b](https://github.com/dunbarcyber/cyphon/commit/09c246b))
<a name="1.6.5"></a>
## [1.6.5](https://github.com/dunbarcyber/cyphon/compare/1.6.4...1.6.5) (2018-06-11)
View
@@ -517,6 +517,11 @@ def saved_data(self):
If successful, returns a data dictionary of the document.
If not, returns an empty dictionary.
"""
has_setting = hasattr(settings, 'ALERTS')
if has_setting and settings.ALERTS.get('DISABLE_COLLECTION_SEARCH'):
return {}
if self.distillery and self.doc_id:
data = self.distillery.find_by_id(self.doc_id)
if data:
@@ -222,6 +222,7 @@ def test_save_alert_w_timestamp(self):
Tests the save method of an Alert when the teaser data for the
original document includes a date that's a timestamp string.
"""
self.alert.data = None
self.alert.save()
utc = datetime.timezone.utc
actual = self.alert.content_date
@@ -414,6 +415,13 @@ def test_data_with_match(self):
expected = DOC_W_DATE
self.assertEqual(actual, expected)
@patch_find_by_id(DOC_W_DATE)
def test_disable_searching_setting(self):
with self.settings(ALERTS={'DISABLE_COLLECTION_SEARCH': True}):
actual = self.alert.saved_data
expected = {}
self.assertEqual(actual, expected)
class GetDataStrTestCase(AlertModelTestCase):
"""
@@ -54,6 +54,11 @@
HOME_DIR = os.path.dirname(PROJ_DIR)
KEYS_DIR = os.path.join(HOME_DIR, 'keys')
ALERTS = {
# Disables searching for alert data in a collection if there is no
# alert data
'DISABLE_COLLECTION_SEARCH': False
}
APPUSERS = {
'CUSTOM_FILTER_BACKENDS': [],

0 comments on commit 94fe98f

Please sign in to comment.