Skip to content

Commit

Permalink
Merge pull request #286 from jayoshih/production
Browse files Browse the repository at this point in the history
Updated email to noreply, catch gaierrors if pypi goes down
  • Loading branch information
aronasorman committed May 12, 2017
2 parents 3354f96 + 3bfbe20 commit c2b04b7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
10 changes: 8 additions & 2 deletions contentcuration/contentcuration/ricecooker_versions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import xmlrpclib
from socket import gaierror

pypi = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
VERSION_OK = "0.5.6"

try:
pypi = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
VERSION_OK = pypi.package_releases('ricecooker')[0]
except gaierror:
pass

VERSION_OK = pypi.package_releases('ricecooker')[0]
VERSION_OK_MESSAGE = "Ricecooker v{} is up-to-date."
VERSION_SOFT_WARNING = "0.5.6"
VERSION_SOFT_WARNING_MESSAGE = "You are using Ricecooker v{}, however v{} is available. You should consider upgrading your Ricecooker."
Expand Down
2 changes: 1 addition & 1 deletion contentcuration/contentcuration/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
# MAILGUN_ACCESS_KEY = 'ACCESS-KEY'
# MAILGUN_SERVER_NAME = 'SERVER-NAME'

DEFAULT_FROM_EMAIL = 'Kolibri Content Curation <info@learningequality.org>'
DEFAULT_FROM_EMAIL = 'Kolibri Content Workshop (Do Not Reply) <noreply@learningequality.org>'
DEFAULT_LICENSE = 1

SERVER_EMAIL = 'curation-errors@learningequality.org'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="{{#if is_disabled}}disabled{{/if}}" {{#if is_disabled}}title="Cannot move to selected topics"{{/if}}>
<div class="move_item_wrapper {{#if is_disabled}}disabled{{/if}}" {{#if is_disabled}}title="Cannot move to selected topics"{{/if}}>
{{#if is_target}}<input type="radio" id="move_item_{{node.id}}_check" class="move_checkbox" name="target_radio_list" {{#if is_disabled}}disabled{{/if}}></input>{{/if}}
<label for="move_item_{{node.id}}_check" class="move_item {{#if is_target}}dblclick_toggle{{else}}{{#if node.children}}tog_folder{{/if}}{{/if}}" {{#unless is_disabled}}title="{{node.title}}"{{/unless}}>
{{#if has_descendants}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ var MoveItem = BaseViews.BaseListNodeItemView.extend({
events: {
'dblclick .dblclick_toggle' : 'toggle',
'click .tog_folder' : 'toggle',
'change >.move_checkbox' : 'handle_checked'
'change >.move_item_wrapper .move_checkbox' : 'handle_checked'
},
render: function() {
var has_descendants = this.model.get('metadata').resource_count < this.model.get('metadata').total_count;
Expand Down
4 changes: 2 additions & 2 deletions contentcuration/contentcuration/view/internal_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def map_files_to_node(node, data):
if file_data.get('language'):
language = Language.objects.get(pk=file_data['language'])

file_path=generate_storage_url(file_data['filename'])
file_path=generate_file_on_disk_name(file_data['filename'])
if not os.path.isfile(file_path):
raise IOError('{} not found'.format(file_path))

Expand All @@ -326,7 +326,7 @@ def map_files_to_assessment_item(question, data):
""" Generate files that reference the content node's assessment items """
for file_data in data:
file_hash = file_data['filename'].split(".")
file_path = generate_storage_url(file_data['filename'])
file_path = generate_file_on_disk_name(file_data['filename'])
if not os.path.isfile(file_path):
raise IOError('{} not found'.format(file_path))

Expand Down

0 comments on commit c2b04b7

Please sign in to comment.