Skip to content

Commit

Permalink
Merge pull request #2612 from zimmerman-team/develop
Browse files Browse the repository at this point in the history
Merge develop into master for new release.
  • Loading branch information
sylvanr authored Jun 7, 2021
2 parents b9d1a6a + fa31036 commit ab255e9
Show file tree
Hide file tree
Showing 21 changed files with 118 additions and 108 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]. All
reported by contacting the project team at [email protected]. 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.
Expand Down
7 changes: 7 additions & 0 deletions OIPA/OIPA/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions OIPA/api/activity/tests/test_save_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def test_create_contact_info(self):
},
"telephone": "0631942897",
"email": "[email protected]",
"website": "https://zimmermanzimmerman.com",
"website": "https://zimmerman.team",
"mailing_address": {
"narratives": [
{
Expand Down Expand Up @@ -906,7 +906,7 @@ def test_update_contact_info(self):
},
"telephone": "0631942897",
"email": "[email protected]",
"website": "https://zimmermanzimmerman.com",
"website": "https://zimmerman.team",
"mailing_address": {
"narratives": [
{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion OIPA/api/generics/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions OIPA/api/iati/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion OIPA/api/organisation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion OIPA/api/publisher/tests/test_verify_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'',
Expand Down
2 changes: 1 addition & 1 deletion OIPA/api/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions OIPA/currency_convert/imf_rate_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion OIPA/iati/PostmanJsonImport/importPostmanJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions OIPA/iati/factory/iati_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Meta:
type = SubFactory(ContactTypeFactory)
telephone = "0044111222333444"
email = "[email protected]"
website = "http://www.example.org"
website = "https://www.example.org"


class RelatedActivityFactory(NoDatabaseFactory):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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/"


Expand Down
Loading

0 comments on commit ab255e9

Please sign in to comment.