Skip to content

Commit

Permalink
Merge bd2d76e into ff84cd6
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Jan 17, 2019
2 parents ff84cd6 + bd2d76e commit 6780d37
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 58 deletions.
9 changes: 1 addition & 8 deletions casepro/api/support.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rest_framework import permissions, views
from rest_framework import permissions


class AdministratorPermission(permissions.BasePermission):
Expand All @@ -7,10 +7,3 @@ class AdministratorPermission(permissions.BasePermission):
def has_permission(self, request, view):
user = request.user
return user.is_authenticated and not user.is_anonymous and user.can_administer(request.org)


def get_view_name(view_cls, suffix=None):
if hasattr(view_cls, "title"):
return view_cls.title

return views.get_view_name(view_cls, suffix)
2 changes: 1 addition & 1 deletion casepro/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class APIRoot(routers.APIRootView):
Below are the endpoints available in the API:
"""

title = _("API v1")
name = _("API v1")


class CreatedOnCursorPagination(pagination.CursorPagination):
Expand Down
2 changes: 1 addition & 1 deletion casepro/backend/junebug.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def receive_identity_store_optout(request):
try:
identity_id = data["identity"]
optout_type = data["optout_type"]
except KeyError as e:
except KeyError:
return JsonResponse({"reason": 'Both "identity" and "optout_type" must be specified.'}, status=400)

# The identity store currently doesn't specify the response format or do
Expand Down
2 changes: 1 addition & 1 deletion casepro/cases/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def sentry_dsn(request):
dsn = getattr(settings, "SENTRY_DSN", None)
public_dsn = None
if dsn:
match = regex.match("^https:\/\/(\w+):\w+@([\w\.\/]+)$", dsn)
match = regex.match(r"^https:\/\/(\w+):\w+@([\w\.\/]+)$", dsn)
if match:
public_key = match.group(1)
path = match.group(2)
Expand Down
2 changes: 1 addition & 1 deletion casepro/contacts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def normalize_phone(cls, number):
Normalizes the passed in phone number
"""
# remove any invalid characters
number = regex.sub("[^0-9a-z\+]", "", number.lower(), regex.V0)
number = regex.sub(r"[^0-9a-z\+]", "", number.lower(), regex.V0)

# add on a plus if it looks like it could be a fully qualified number
if len(number) >= 11 and number[0] not in ["+", "0"]:
Expand Down
2 changes: 1 addition & 1 deletion casepro/msgs/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def clean_name(self):
raise forms.ValidationError(_("Label name must be %d characters or less") % Label.MAX_NAME_LEN)

# first character must be a word char
elif not regex.match("\w", name[0], flags=regex.UNICODE):
elif not regex.match(r"\w", name[0], flags=regex.UNICODE):
raise forms.ValidationError(_("Label name must start with a letter or digit"))
return name

Expand Down
1 change: 0 additions & 1 deletion casepro/settings_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,4 @@
"DEFAULT_PERMISSION_CLASSES": ("casepro.api.support.AdministratorPermission",),
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.CursorPagination",
"PAGE_SIZE": 100,
"VIEW_NAME_FUNCTION": "casepro.api.support.get_view_name",
}
2 changes: 1 addition & 1 deletion casepro/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def get_language_name(iso_code):

if lang:
# we only show up to the first semi or paren
lang = re.split(";|\(", lang.name)[0].strip()
lang = re.split(r";|\(", lang.name)[0].strip()

LANGUAGES_BY_CODE[iso_code] = lang

Expand Down
81 changes: 39 additions & 42 deletions pip-freeze.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,63 @@
# pip-compile --output-file pip-freeze.txt pip-requires.txt
#
-e git+https://github.com/nyaruka/confmodel.git@python3#egg=confmodel
amqp==2.3.2 # via kombu
billiard==3.5.0.4 # via celery
amqp==2.4.0 # via kombu
billiard==3.5.0.5 # via celery
boto==2.49.0
celery==4.2.1
certifi==2018.8.13 # via requests
certifi==2018.11.29 # via requests
chardet==3.0.4 # via requests
colorama==0.3.9
cookies==2.2.1 # via responses
coverage==4.5.1
colorama==0.4.1
coverage==4.5.2
dj-database-url==0.5.0
django-appconf==1.0.2 # via django-celery-email, django-compressor
django-celery-email==2.0.0
django-celery-email==2.0.1
django-compressor==2.2
django-contrib-comments==1.9.0
django-digest==1.13
django-el-pagination==3.2.4
django-hamlpy==1.1.1 # via rapidpro-dash
django-redis==4.9.0
django-rosetta==0.8.3
django-storages==1.6.6
django-timezone-field==2.1 # via rapidpro-dash
django==2.0.8
djangorestframework==3.8.2
enum34==1.1.6 # via django-hamlpy
flake8==3.5.0
future==0.16.0 # via django-hamlpy
django-hamlpy==1.2 # via rapidpro-dash
django-redis==4.10.0
django-rosetta==0.9.0
django-storages==1.7.1
django-timezone-field==3.0 # via rapidpro-dash
django==2.1.5
djangorestframework==3.9.1
flake8==3.6.0
gunicorn==19.9.0
idna==2.7 # via requests
idna==2.8 # via requests
iso-639==0.4.5
iso8601==0.1.12 # via rapidpro-python
kombu==4.2.1 # via celery
markdown==2.6.11
kombu==4.2.2.post1 # via celery
markdown==3.0.1
mccabe==0.6.1 # via flake8
phonenumbers==8.9.10 # via rapidpro-dash
pillow==5.2.0
phonenumbers==8.10.3 # via rapidpro-dash
pillow==5.4.1
pisa==3.0.33
polib==1.1.0 # via django-rosetta
psycopg2-binary==2.7.5 # via rapidpro-dash
psycopg2==2.7.5
pycodestyle==2.3.1 # via flake8
pycountry==18.5.26
pyflakes==1.6.0 # via flake8
python-dateutil==2.7.3
pytz==2018.5 # via celery, django, django-timezone-field, rapidpro-python, smartmin
rapidpro-dash==1.4
psycopg2-binary==2.7.6.1 # via rapidpro-dash
psycopg2==2.7.6.1
pycodestyle==2.4.0 # via flake8
pycountry==18.12.8
pyflakes==2.0.0 # via flake8
python-dateutil==2.7.5
pytz==2018.9 # via celery, django, django-timezone-field, rapidpro-python, smartmin
rapidpro-dash==1.4.3
rapidpro-python==2.4
raven==6.9.0
raven==6.10.0
rcssmin==1.0.6 # via django-compressor
redis==2.10.6
regex==2018.7.11
requests==2.19.1 # via django-rosetta, rapidpro-dash, rapidpro-python, responses
responses==0.9.0
redis==3.0.1
regex==2018.11.22
requests==2.21.0 # via django-rosetta, rapidpro-dash, rapidpro-python, responses
responses==0.10.5
rjsmin==1.0.12 # via django-compressor
six==1.11.0 # via django-hamlpy, django-rosetta, python-dateutil, rapidpro-python, responses
smartmin==2.0.0
sorl-thumbnail==12.4.1
six==1.12.0 # via django-rosetta, python-dateutil, rapidpro-python, responses
smartmin==2.1.2
sorl-thumbnail==12.5.0
sqlparse==0.2.4 # via smartmin
urllib3==1.23 # via requests
vine==1.1.4 # via amqp
xlrd==1.1.0 # via rapidpro-dash, smartmin, xlutils
urllib3==1.24.1 # via requests
vine==1.2.0 # via amqp
xlrd==1.2.0 # via rapidpro-dash, smartmin, xlutils
xlutils==2.0.0
xlwt==1.3.0 # via rapidpro-dash, smartmin, xlutils
zope.interface==4.5.0
zope.interface==4.6.0
2 changes: 1 addition & 1 deletion pip-requires.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
############## Django ##############

django<2.1
django<2.2
djangorestframework
django-celery-email
django-compressor
Expand Down

0 comments on commit 6780d37

Please sign in to comment.