Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit f8f43d4

Browse files
committed
add kosovo to list of supported countries
1 parent afd9164 commit f8f43d4

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

codeweekeu/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@
489489
u'ZA': None,
490490
u'ZM': None,
491491
u'ZW': None,
492+
u'XK': 'Kosovo',
492493
}
493494
########## END ATHENTICATION CONFIGURATION
494495

static/js/events.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ var Codeweek = window.Codeweek || {};
7575
function updateAddress(new_latLng) {
7676
geocoder = new google.maps.Geocoder();
7777
geocoder.geocode({'latLng': new_latLng}, function (results, status) {
78-
if (status === google.maps.GeocoderStatus.OK) {
78+
if ( status === google.maps.GeocoderStatus.OK ||
79+
( status === google.maps.GeocoderStatus.ZERO_RESULTS && results.length > 0 ) ) {
7980
document.getElementById("autocomplete").value = results[0].formatted_address;
8081
// the last item in the geocoder for latLng results array is the country
81-
var country = results[results.length - 1].address_components[0].short_name
82+
var country = results.slice(-1)[0].address_components.slice(-1)[0].short_name;
83+
8284
updateCountrySelection(country);
8385
}
8486
});

web/forms/event_form.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ class SearchEventForm(forms.Form):
161161

162162
# XK is temp code for Kosovo; remove from COUNTRIES_OVERRIDE when
163163
# Kosovo gets its own ISO code and is added to django-countries
164-
#if not 'Kosovo' in list(dict(countries._countries).values()):
165-
# countries._countries.append((u'XK', u'Kosovo'))
164+
if not 'Kosovo' in list(dict(countries._countries).values()):
165+
countries._countries.append((u'XK', u'Kosovo'))
166166

167167
search = forms.CharField(
168168
required=False,

0 commit comments

Comments
 (0)