Skip to content

Commit

Permalink
Merge 7d68b81 into 1eedeb9
Browse files Browse the repository at this point in the history
  • Loading branch information
moh-moola committed Aug 13, 2018
2 parents 1eedeb9 + 7d68b81 commit 39c28e4
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sudo: false
language: python
python:
- '2.7'
- '3.6'

env:
- TEST=molo_lint
Expand All @@ -13,6 +14,7 @@ cache: pip
before_install:
- pip install --upgrade pip
install:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install -e .
- pip install coveralls
Expand Down
2 changes: 1 addition & 1 deletion molo/globalsite/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.conf import settings
from django.core.urlresolvers import reverse
from molo.globalsite import geo
from models import GlobalSiteSettings
from molo.globalsite.models import GlobalSiteSettings


class CountrySiteRedirectMiddleware(object):
Expand Down
7 changes: 3 additions & 4 deletions molo/globalsite/urls.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from django.conf.urls import patterns, url
from django.conf.urls import url
from molo.globalsite import views


urlpatterns = patterns(
'',
urlpatterns = [
url(r'^countries/$', views.CountryView.as_view(),
name='country_selection'),

url(r'^setcountry/(?P<country_code>[\w-]+)/$',
views.set_country, name='set_country'),

url(r'^changecountry/$', views.change_country, name='change_country'),
)
]
4 changes: 2 additions & 2 deletions molo/globalsite/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import urlparse
from django.utils.six.moves.urllib.parse import urlparse, urljoin
from django.conf import settings
from django.shortcuts import redirect
from django.views.generic import TemplateView
Expand All @@ -25,5 +25,5 @@ def set_country(request, country_code):
def change_country(request):
if hasattr(settings, 'GLOBAL_SITE_URL'):
global_site = settings.GLOBAL_SITE_URL
url = urlparse.urljoin(global_site, '/globalsite/countries/')
url = urlparse(urljoin(global_site, '/globalsite/countries/'))
return redirect(url)
3 changes: 2 additions & 1 deletion molo/globalsite/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register, ModelAdminGroup)
from models import CountrySite, Region

from molo.globalsite.models import CountrySite, Region


class RegionModelAdmin(ModelAdmin):
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest==3.0.0
pytest-django==2.9.1
pytest-django==3.1.2
pytest-cov
pytest-xdist
flake8==3.4.1
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
molo.core<6.0.0,>=5.21.2
molo.core<7.0.0,>=6.0.1
geoip2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
author='Praekelt.org',
author_email='dev@praekelt.org',
url='http://github.com/praekelt/molo.globalsite',
url='https://github.com/praekeltfoundation/molo.globalsite',
license='BSD',
keywords='praekelt, mobi, web, django',
packages=find_packages(),
Expand Down

0 comments on commit 39c28e4

Please sign in to comment.