Skip to content

Commit

Permalink
Merge pull request #228 from domino14/bug/xxx/word_lists
Browse files Browse the repository at this point in the history
Bug/xxx/word lists
  • Loading branch information
domino14 authored Mar 14, 2017
2 parents 70107f3 + ee3a942 commit e265cb2
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 168 deletions.
2 changes: 1 addition & 1 deletion djAerolith/current_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_VERSION = '0.10.0.2'
CURRENT_VERSION = '0.10.0.3'
4 changes: 3 additions & 1 deletion djAerolith/wordwalls/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ def load_aerolith_list(request, parsed_req_body):
named_list = NamedList.objects.get(pk=parsed_req_body['selectedList'])
except NamedList.DoesNotExist:
return bad_request('List does not exist.')
except (TypeError, ValueError):
return bad_request('Please select a list.')
tablenum = WordwallsGame().initialize_by_named_list(
parsed_req_body['lexicon'], request.user, named_list,
parsed_req_body['quiz_time_secs'],
Expand Down Expand Up @@ -255,7 +257,7 @@ def default_lists(request):
return bad_request('Bad lexicon.')

ret_data = []
for nl in NamedList.objects.filter(lexicon=lex):
for nl in NamedList.objects.filter(lexicon=lex).order_by('id'):
ret_data.append({
'name': nl.name,
'lexicon': nl.lexicon.lexiconName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ class TableCreator extends React.Component {
},
method: 'GET',
})
.done(data => this.setState({ aerolithLists: data }))
.done(data => this.setState({
aerolithLists: data,
selectedList: data[0] ? String(data[0].id) : '',
}))
.always(() => this.hideSpinner());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const SolutionsModal = props => (
modalClass="solutions-modal"
size="modal-lg"
>
<div className="modal-body">
<div className="modal-body" style={{ height: '80vh', overflowY: 'auto' }} >
<Solutions
questions={props.questions}
answeredByMe={props.answeredByMe}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class PrefsModalBody extends React.Component {
</div>
</div>

<div className="row">
<div className="row" style={{ height: '65vh', overflowY: 'auto' }}>
<div className="col-lg-12">

<form>
Expand Down

This file was deleted.

25 changes: 0 additions & 25 deletions djAerolith/wordwalls/templates/wordwalls/forms/default_lists.html

This file was deleted.

58 changes: 0 additions & 58 deletions djAerolith/wordwalls/templates/wordwalls/forms/saved_lists.html

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions djAerolith/wordwalls/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,6 @@ def handle_table_post(request, tableid):
logger.debug(u'user=%s, action=%s, table=%s', request.user, action,
tableid)

# XXX: Remove this shortly after deploying SPA. This is just for the
# transition period.
if action in ['challengeSubmit', 'searchParamsSubmit', 'savedListsSubmit',
'namedListsSubmit']:
# This is one of the old actions, for the old app (not the SPA).
# Return an error message using the old formatting for the app.
# Note the implicit 200 status code.
return response({
'success': False,
'error': 'Aerolith has been updated; please refresh your browser.'
})
# XXX: End of transition code.

if not tableid or int(tableid) == 0: # Kind of hacky.
return response({
'success': False,
Expand Down

0 comments on commit e265cb2

Please sign in to comment.