Skip to content

Commit

Permalink
Removing the batch file option (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazet authored Apr 26, 2024
1 parent c2c6a8e commit 294f42b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
14 changes: 1 addition & 13 deletions artemis/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
from typing import Dict, List, Optional

import requests
from fastapi import (
APIRouter,
Depends,
File,
Form,
Header,
HTTPException,
Request,
Response,
)
from fastapi import APIRouter, Depends, Form, Header, HTTPException, Request, Response
from fastapi.responses import JSONResponse, RedirectResponse
from fastapi_csrf_protect import CsrfProtect
from karton.core.backend import KartonBackend, KartonBind
Expand Down Expand Up @@ -130,7 +121,6 @@ def get_add_form(request: Request, csrf_protect: CsrfProtect = Depends()) -> Res
async def post_add(
request: Request,
targets: Optional[str] = Form(None),
file: Optional[bytes] = File(None),
tag: Optional[str] = Form(None),
priority: Optional[str] = Form(None),
choose_modules_to_enable: Optional[bool] = Form(None),
Expand All @@ -148,8 +138,6 @@ async def post_add(
total_list: List[str] = []
if targets:
total_list += (x.strip() for x in targets.split())
if file:
total_list += (x.strip() for x in file.decode().split())

for task in total_list:
if not Classifier.is_supported(task):
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pydantic==2.3.0
pymongo==4.6.3
PyMySQL==1.1.0
python-decouple==3.8
python-multipart==0.0.9
pytz==2024.1
PyYAML==6.0.1
redis==5.0.3
Expand Down
4 changes: 0 additions & 4 deletions templates/add.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
<textarea class="form-control" name="targets">{% for task in tasks %}{{ task }}
{% endfor %}</textarea>
</div>
<div class="form-group mb-3">
<label class="form-label">Batch file (should contain one target per line)</label>
<input class="form-control btn" type="file" name="file">
</div>
<div class="form-group mb-3">
<label class="form-label">Tag</label>
<input type="text" class="form-control" name="tag" value="{{ tag }}">
Expand Down

0 comments on commit 294f42b

Please sign in to comment.