diff --git a/.pylintrc b/.pylintrc index fecba8c..1745113 100644 --- a/.pylintrc +++ b/.pylintrc @@ -123,34 +123,9 @@ required-attributes= # List of builtins function names that should not be used, separated by a comma bad-functions=map,filter,apply,input -# Regular expression which should only match correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Regular expression which should only match correct module level names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Regular expression which should only match correct class names -class-rgx=[A-Z_][a-zA-Z0-9]+$ - # Regular expression which should only match correct function names function-rgx=[a-z_][a-z0-9_]{2,50}$ -# Regular expression which should only match correct method names -method-rgx=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression which should only match correct instance attribute names -attr-rgx=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression which should only match correct argument names -argument-rgx=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression which should only match correct variable names -variable-rgx=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression which should only match correct list comprehension / -# generator expression variable names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ - # Good variable names which should always be accepted, separated by a comma good-names=i,j,k,ex,Run,_ diff --git a/.travis.yml b/.travis.yml index bbe4321..57058d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,8 @@ before_install: - "sh -e /etc/init.d/xvfb start" install: - - pip install -r requirements.txt + - "pip install -r requirements.txt" + - "pip uninstall -y xblock-google-drive && python setup.py sdist && pip install dist/xblock-google-drive-0.1.tar.gz" script: - DJANGO_SETTINGS_MODULE="settings" nosetests --with-coverage --cover-package="google_drive" --with-django diff --git a/google_drive/google_docs.py b/google_drive/google_docs.py index f5ec624..516122a 100644 --- a/google_drive/google_docs.py +++ b/google_drive/google_docs.py @@ -121,10 +121,15 @@ def check_url(self, data, suffix=''): # pylint: disable=unused-argument,no-self """ Checks that the given document url is accessible, and therefore assumed to be valid """ - test_url = data['url'] try: + test_url = data['url'] url_response = requests.head(test_url) - # Catch wide range of errors + except KeyError as ex: + LOG.debug("URL not provided - %s", unicode(ex)) + return { + 'status_code': 400, + } + # Catch wide range of request exceptions except requests.exceptions.RequestException as ex: LOG.debug("Unable to connect to %s - %s", test_url, unicode(ex)) return { diff --git a/google_drive/templates/html/google_calendar_edit.html b/google_drive/templates/html/google_calendar_edit.html index 0a5f62b..669bb0b 100644 --- a/google_drive/templates/html/google_calendar_edit.html +++ b/google_drive/templates/html/google_calendar_edit.html @@ -1,7 +1,7 @@ {% load i18n %} -
+
@@ -17,7 +17,7 @@

{% trans "Invalid Google Calendar" %}

@@ -28,7 +28,7 @@

{% trans "Invalid Google Calendar" %}

@@ -57,7 +57,7 @@

{% trans "Invalid Google Calendar" %}