mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-23 00:59:59 +00:00
Fix lint errors
This commit is contained in:
parent
7066fb258e
commit
159d5a5d9e
|
@ -107,7 +107,7 @@ def api_upload(upload_request, user):
|
||||||
return flask.make_response(flask.jsonify(
|
return flask.make_response(flask.jsonify(
|
||||||
{'Failure': ['No torrent file was attached.']}), 400)
|
{'Failure': ['No torrent file was attached.']}), 400)
|
||||||
|
|
||||||
form = forms.UploadForm(CombinedMultiDict((torrent_file, form_info)), meta={'csrf':False})
|
form = forms.UploadForm(CombinedMultiDict((torrent_file, form_info)), meta={'csrf': False})
|
||||||
form.category.choices = _create_upload_category_choices()
|
form.category.choices = _create_upload_category_choices()
|
||||||
|
|
||||||
if upload_request.method == 'POST' and form.validate():
|
if upload_request.method == 'POST' and form.validate():
|
||||||
|
@ -138,7 +138,7 @@ UPLOAD_API_FORM_KEYMAP = {
|
||||||
}
|
}
|
||||||
UPLOAD_API_FORM_KEYMAP_REVERSE = {v: k for k, v in UPLOAD_API_FORM_KEYMAP.items()}
|
UPLOAD_API_FORM_KEYMAP_REVERSE = {v: k for k, v in UPLOAD_API_FORM_KEYMAP.items()}
|
||||||
UPLOAD_API_DEFAULTS = {
|
UPLOAD_API_DEFAULTS = {
|
||||||
'name' : '',
|
'name': '',
|
||||||
'category': '',
|
'category': '',
|
||||||
'anonymous': False,
|
'anonymous': False,
|
||||||
'hidden': False,
|
'hidden': False,
|
||||||
|
@ -169,7 +169,7 @@ def v2_api_upload():
|
||||||
mapped_dict[mapped_key] = request_data.get(key, default)
|
mapped_dict[mapped_key] = request_data.get(key, default)
|
||||||
|
|
||||||
# Flask-WTF (very helpfully!!) automatically grabs the request form, so force a None formdata
|
# Flask-WTF (very helpfully!!) automatically grabs the request form, so force a None formdata
|
||||||
upload_form = forms.UploadForm(None, data=mapped_dict, meta={'csrf':False})
|
upload_form = forms.UploadForm(None, data=mapped_dict, meta={'csrf': False})
|
||||||
upload_form.category.choices = _create_upload_category_choices()
|
upload_form.category.choices = _create_upload_category_choices()
|
||||||
|
|
||||||
if upload_form.validate():
|
if upload_form.validate():
|
||||||
|
@ -193,7 +193,7 @@ def v2_api_upload():
|
||||||
|
|
||||||
# #################################### TEMPORARY ####################################
|
# #################################### TEMPORARY ####################################
|
||||||
|
|
||||||
from orderedset import OrderedSet
|
from orderedset import OrderedSet # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
@api_blueprint.route('/ghetto_import', methods=['POST'])
|
@api_blueprint.route('/ghetto_import', methods=['POST'])
|
||||||
|
|
|
@ -166,7 +166,6 @@ class EditForm(FlaskForm):
|
||||||
|
|
||||||
|
|
||||||
class UploadForm(FlaskForm):
|
class UploadForm(FlaskForm):
|
||||||
|
|
||||||
torrent_file = FileField('Torrent file', [
|
torrent_file = FileField('Torrent file', [
|
||||||
FileRequired()
|
FileRequired()
|
||||||
])
|
])
|
||||||
|
|
|
@ -215,7 +215,9 @@ def home(rss):
|
||||||
query_results = search_elastic(**query_args)
|
query_results = search_elastic(**query_args)
|
||||||
|
|
||||||
if render_as_rss:
|
if render_as_rss:
|
||||||
return render_rss('"{}"'.format(search_term), query_results, use_elastic=True, magnet_links=use_magnet_links)
|
return render_rss(
|
||||||
|
'"{}"'.format(search_term), query_results,
|
||||||
|
use_elastic=True, magnet_links=use_magnet_links)
|
||||||
else:
|
else:
|
||||||
rss_query_string = _generate_query_string(
|
rss_query_string = _generate_query_string(
|
||||||
search_term, category, quality_filter, user_name)
|
search_term, category, quality_filter, user_name)
|
||||||
|
@ -637,7 +639,8 @@ def edit_torrent(torrent_id):
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flask.flash(flask.Markup(
|
flask.flash(flask.Markup(
|
||||||
'Torrent has been successfully edited! Changes might take a few minutes to show up.'), 'info')
|
'Torrent has been successfully edited! Changes might take a few minutes to show up.'),
|
||||||
|
'info')
|
||||||
|
|
||||||
return flask.redirect(flask.url_for('view_torrent', torrent_id=torrent.id))
|
return flask.redirect(flask.url_for('view_torrent', torrent_id=torrent.id))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue