diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index cc091c97f..6f3ddf844 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at github@zimmermanzimmerman.nl. All +reported by contacting the project team at info@zimmerman.team. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/OIPA/OIPA/settings.py b/OIPA/OIPA/settings.py index 77e18883c..64a7cafba 100644 --- a/OIPA/OIPA/settings.py +++ b/OIPA/OIPA/settings.py @@ -387,6 +387,10 @@ def rel(*x): 'task': 'iati.PostmanJsonImport.tasks.get_postman_api', 'schedule': crontab(minute=0, hour=0), }, + 'Update the exchange rates': { + 'task': 'task_queue.tasks.update_exchange_rates', + 'schedule': crontab(minute=0, hour=0), + }, } SOLR = { @@ -430,6 +434,9 @@ def rel(*x): } } +# To be overwritten by local_settings.py in any case for security purposes. +POSTMAN_API_KEY = 'OverwriteFromLocalSettings' + try: from .local_settings import * # noqa: F401, F403 except ImportError: diff --git a/OIPA/api/activity/tests/test_save_serializers.py b/OIPA/api/activity/tests/test_save_serializers.py index 199d2c0c3..c368f0952 100644 --- a/OIPA/api/activity/tests/test_save_serializers.py +++ b/OIPA/api/activity/tests/test_save_serializers.py @@ -772,7 +772,7 @@ def test_create_contact_info(self): }, "telephone": "0631942897", "email": "test@zz.com", - "website": "https://zimmermanzimmerman.com", + "website": "https://zimmerman.team", "mailing_address": { "narratives": [ { @@ -906,7 +906,7 @@ def test_update_contact_info(self): }, "telephone": "0631942897", "email": "test@zz.com", - "website": "https://zimmermanzimmerman.com", + "website": "https://zimmerman.team", "mailing_address": { "narratives": [ { @@ -1424,7 +1424,7 @@ def test_create_location(self): "latitude": "31.616944", "longitude": "65.716944", }, - "srsName": "http://www.opengis.net/def/crs/EPSG/0/4326", + "srsName": "https://www.opengis.net/def/crs/EPSG/0/4326", }, "exactness": { "code": exactness.code, @@ -1566,7 +1566,7 @@ def test_update_location(self): "latitude": "31.616944", "longitude": "65.716944", }, - "srsName": "http://www.opengis.net/def/crs/EPSG/0/4326", + "srsName": "https://www.opengis.net/def/crs/EPSG/0/4326", }, "exactness": { "code": exactness.code, @@ -1692,7 +1692,7 @@ def test_create_humanitarian_scope(self): "code": vocabulary.code, "name": 'irrelevant', }, - "vocabulary_uri": "https://github.com/zimmerman-zimmerman", + "vocabulary_uri": "https://github.com/zimmerman-team", } res = self.c.post( @@ -1729,7 +1729,7 @@ def test_update_humanitarian_scope(self): "code": vocabulary.code, "name": 'irrelevant', }, - "vocabulary_uri": "https://github.com/zimmerman-zimmerman", + "vocabulary_uri": "https://github.com/zimmerman-team", } res = self.c.put( diff --git a/OIPA/api/generics/serializers.py b/OIPA/api/generics/serializers.py index 03e8a2184..ff01562f9 100644 --- a/OIPA/api/generics/serializers.py +++ b/OIPA/api/generics/serializers.py @@ -61,7 +61,7 @@ class FilteredListSerializer(serializers.ListSerializer): def __init__(cls, *args, **kwargs): cls.filter_class = kwargs.pop('filter_class', ()) - return super(FilteredListSerializer, cls).__init__(*args, **kwargs) + return None def to_representation(self, queryset): request = self.context.get("request") diff --git a/OIPA/api/iati/references.py b/OIPA/api/iati/references.py index ad58b3436..1355f80b2 100644 --- a/OIPA/api/iati/references.py +++ b/OIPA/api/iati/references.py @@ -505,10 +505,10 @@ class TransactionReference(ElementReference): def create(self): if 'message' in self.data: ns_map = {"zz": - "https://www.zimmermanzimmerman.nl"} + "https://www.zimmerman.team"} transaction_element = etree.SubElement( self.parent_element, - "{https://www.zimmermanzimmerman.nl}"+self.element, + "{https://www.zimmerman.team}"+self.element, nsmap=ns_map ) else: @@ -1175,10 +1175,10 @@ class BudgetReference(ElementReference): def create(self): if 'message' in self.data: ns_map = {"zz": - "https://www.zimmermanzimmerman.nl"} + "https://www.zimmerman.team"} budget_element = etree.SubElement( self.parent_element, - "{https://www.zimmermanzimmerman.nl}"+self.element, + "{https://www.zimmerman.team}"+self.element, nsmap=ns_map ) else: diff --git a/OIPA/api/organisation/views.py b/OIPA/api/organisation/views.py index 20136ead1..91c2cf050 100644 --- a/OIPA/api/organisation/views.py +++ b/OIPA/api/organisation/views.py @@ -273,7 +273,7 @@ class UpdateOrganisationSearchMixin(object): def reindex_organisation(self, serializer): instance = serializer.instance.get_organisation() - self.reindex_organisation(instance) + return instance def perform_create(self, serializer): serializer.save() diff --git a/OIPA/api/publisher/tests/test_verify_key.py b/OIPA/api/publisher/tests/test_verify_key.py index ae64246cb..b69df7726 100644 --- a/OIPA/api/publisher/tests/test_verify_key.py +++ b/OIPA/api/publisher/tests/test_verify_key.py @@ -58,7 +58,7 @@ def fake_call_action(self, arg, whatever): u'publisher_organization_type': u'70', u'tags': [], u'groups': [], - u'publisher_ui_url': u'http://www.openaidsearch.org', + u'publisher_ui_url': u'https://www.openaidsearch.org', u'publisher_timeliness': u'', u'publisher_source_type': u'primary_source', u'publisher_segmentation': u'', diff --git a/OIPA/api/renderers.py b/OIPA/api/renderers.py index f3335d54f..b79eb16a7 100644 --- a/OIPA/api/renderers.py +++ b/OIPA/api/renderers.py @@ -891,7 +891,7 @@ def render(self, data, accepted_media_type=None, renderer_context=None): # the element with namespace must be the last element in the xml. for element in self.xml.iter(): - if element.tag.find("https://www.zimmermanzimmerman.n") != -1: + if element.tag.find("https://www.zimmerman.team") != -1: print(element.tag) parent = element.getparent() parent.remove(element) diff --git a/OIPA/currency_convert/imf_rate_parser.py b/OIPA/currency_convert/imf_rate_parser.py index f801b64cc..9a47fa7f4 100644 --- a/OIPA/currency_convert/imf_rate_parser.py +++ b/OIPA/currency_convert/imf_rate_parser.py @@ -54,8 +54,8 @@ def get_xml_data(self, url, download_url, retry_count=0): class RateParser(): def __init__(self): - self.imf_url = "http://www.imf.org/external/np/fin/ert/GUI/Pages/Report.aspx?Type=XML&CU=%27EUR%27,%27JPY%27,%27GBP%27,%27USD%27,%27DZD%27,%27AUD%27,%27ATS%27,%27BHD%27,%27BEF%27,%27VEF%27,%27BWP%27,%27BRL%27,%27BND%27,%27CAD%27,%27CLP%27,%27CNY%27,%27COP%27,%27CYP%27,%27CZK%27,%27DKK%27,%27DEM%27,%27FIM%27,%27FRF%27,%27GRD%27,%27HUF%27,%27ISK%27,%27INR%27,%27IDR%27,%27IRR%27,%27IEP%27,%27ILS%27,%27ITL%27,%27KZT%27,%27KRW%27,%27EEK%27,%27KWD%27,%27LYD%27,%27LUF%27,%27MYR%27,%27MTL%27,%27MUR%27,%27MXN%27,%27NPR%27,%27NLG%27,%27NZD%27,%27NOK%27,%27PEN%27,%27PKR%27,%27UYU%27,%27PHP%27,%27PLN%27,%27PTE%27,%27QAR%27,%27OMR%27,%27RUB%27,%27SAR%27,%27SGD%27,%27SKK%27,%27SIT%27,%27ZAR%27,%27ESP%27,%27LKR%27,%27SEK%27,%27CHF%27,%27THB%27,%27TTD%27,%27TND%27,%27AED%27,%27VEB%27&EX=SDRC&P=DateRange&CF=UnCompressed&CUF=Period&DS=Ascending&DT=NA" # NOQA: E501 - self.imf_download_url = "http://www.imf.org/external/np/fin/ert/GUI/Pages/ReportData.aspx?Type=XML" # NOQA: E501 + self.imf_url = "https://www.imf.org/external/np/fin/ert/GUI/Pages/Report.aspx?Type=XML&CU=%27EUR%27,%27JPY%27,%27GBP%27,%27USD%27,%27DZD%27,%27AUD%27,%27ATS%27,%27BHD%27,%27BEF%27,%27VEF%27,%27BWP%27,%27BRL%27,%27BND%27,%27CAD%27,%27CLP%27,%27CNY%27,%27COP%27,%27CYP%27,%27CZK%27,%27DKK%27,%27DEM%27,%27FIM%27,%27FRF%27,%27GRD%27,%27HUF%27,%27ISK%27,%27INR%27,%27IDR%27,%27IRR%27,%27IEP%27,%27ILS%27,%27ITL%27,%27KZT%27,%27KRW%27,%27EEK%27,%27KWD%27,%27LYD%27,%27LUF%27,%27MYR%27,%27MTL%27,%27MUR%27,%27MXN%27,%27NPR%27,%27NLG%27,%27NZD%27,%27NOK%27,%27PEN%27,%27PKR%27,%27UYU%27,%27PHP%27,%27PLN%27,%27PTE%27,%27QAR%27,%27OMR%27,%27RUB%27,%27SAR%27,%27SGD%27,%27SKK%27,%27SIT%27,%27ZAR%27,%27ESP%27,%27LKR%27,%27SEK%27,%27CHF%27,%27THB%27,%27TTD%27,%27TND%27,%27AED%27,%27VEB%27&EX=SDRC&P=DateRange&CF=UnCompressed&CUF=Period&DS=Ascending&DT=NA" # NOQA: E501 + self.imf_download_url = "https://www.imf.org/external/np/fin/ert/GUI/Pages/ReportData.aspx?Type=XML" # NOQA: E501 self.updated_imf_url = '' self.year = 1993 self.month = 12 diff --git a/OIPA/iati/PostmanJsonImport/importPostmanJson.py b/OIPA/iati/PostmanJsonImport/importPostmanJson.py index 126ae995b..7ce8ed074 100644 --- a/OIPA/iati/PostmanJsonImport/importPostmanJson.py +++ b/OIPA/iati/PostmanJsonImport/importPostmanJson.py @@ -18,7 +18,7 @@ def get_json(self): request = urllib.request.Request( "https://api.getpostman.com/collections/7423966-c07eebd3-61b2-47b4-9bfd-1bac7ec96c9f", # NOQA: E501 - headers={"x-Api-Key": "675aba3b5dec4d39a1abf193d4386c7b"}) + headers={"x-Api-Key": settings.POSTMAN_API_KEY}) response = urllib.request.urlopen(request) json_string = response.read() result_for_test_datastore_iatistandard_org = json.loads(json_string.decode('utf-8-sig')) # NOQA: E501 diff --git a/OIPA/iati/factory/iati_factory.py b/OIPA/iati/factory/iati_factory.py index 52dbbcb79..01c063448 100644 --- a/OIPA/iati/factory/iati_factory.py +++ b/OIPA/iati/factory/iati_factory.py @@ -210,7 +210,7 @@ class Meta: type = SubFactory(ContactTypeFactory) telephone = "0044111222333444" email = "transparency@example.org" - website = "http://www.example.org" + website = "https://www.example.org" class RelatedActivityFactory(NoDatabaseFactory): @@ -673,7 +673,7 @@ class Meta: location_id_vocabulary = SubFactory(GeographicVocabularyFactory) location_id_code = '23213' point_pos = GEOSGeometry(Point(20.22, 45.22), srid=4326) - point_srs_name = "http://www.opengis.net/def/crs/EPSG/0/4326" + point_srs_name = "https://www.opengis.net/def/crs/EPSG/0/4326" exactness = SubFactory(GeographicExactnessFactory) location_class = SubFactory(GeographicLocationClassFactory) feature_designation = SubFactory(LocationTypeFactory) @@ -860,7 +860,7 @@ class Meta: code = "code" type = SubFactory(HumanitarianScopeTypeFactory) vocabulary = SubFactory(HumanitarianScopeVocabularyFactory) - vocabulary_uri = "http://reference.iatistandard.org/202/activity-standard/\ + vocabulary_uri = "https://reference.iatistandard.org/202/activity-standard/\ iati-activities/iati-activity/humanitarian-scope/" diff --git a/OIPA/iati/migrations/OIPA: The IATI Data-engine.html b/OIPA/iati/migrations/OIPA: The IATI Data-engine.html index 87f49aca4..8cc356b08 100644 --- a/OIPA/iati/migrations/OIPA: The IATI Data-engine.html +++ b/OIPA/iati/migrations/OIPA: The IATI Data-engine.html @@ -1,32 +1,32 @@ - + - - + + - + OIPA: The IATI Data-engine - + - - - - + + + + - + - + - +