Skip to content

Commit

Permalink
fix error w/redirecting from "/upload" to "/upload/"
Browse files Browse the repository at this point in the history
  • Loading branch information
HadronCollider committed Dec 15, 2024
1 parent 4eb3738 commit 354c605
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% if not current_user.is_anonymous %}
<div class="col-sm-4 col-md-3 col-lg-2 my-auto">
{% if navi_upload %}
<a class="header-linked text-center" href="/upload" id="upload_ref_link">Загрузить новый файл</a>
<a class="header-linked text-center" href="/upload/" id="upload_ref_link">Загрузить новый файл</a>
{% endif %}
</div>

Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ $("#login_button").click(async () => {
const name = await (await fetch("/login", post_data)).text();
console.log("User " + name + " was" + (name === "" ? " not" : "") + " logged in");
if (name === "") $("#login_text_field").toggleClass("is-invalid", true);
else window.location.href = "/upload";
else window.location.href = "/upload/";
});
2 changes: 1 addition & 1 deletion assets/scripts/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ $("#signup_button").click(async () => {
const name = await (await fetch("/signup", post_data)).text();
console.log("User " + name + " was" + (name === "" ? " not" : "") + " signed up");
if (name === "") $("#login_text_field").toggleClass("is-invalid", true);
else window.location.href = "/upload";
else window.location.href = "/upload/";
});
2 changes: 1 addition & 1 deletion assets/scripts/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ async function upload() {
method: "POST",
body: formData
};
const response_text = await (await fetch("/upload", post_data)).text();
const response_text = await (await fetch("/upload/", post_data)).text();
console.log("Answer:", response_text);
bar.css("width", "100%").attr('aria-valuenow', 100);
console.log(file);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ def test_complete_auth(self):
time.sleep(10)
self.check_auth(login, password)
time.sleep(10)
upload_url = self.get_url('/upload')
upload_url = self.get_url('/upload/')
self.assertIn(upload_url, self.get_driver().current_url)
2 changes: 1 addition & 1 deletion tests/test_file_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def upload_file(self, report_ext):

def check_pack(self):
self.authorization()
URL = self.get_url('/upload')
URL = self.get_url('/upload/')
self.get_driver().get(URL)
self.get_driver().implicitly_wait(30)
# obj = self.get_driver().find_element(By.XPATH, "/html/body/div/div[2]/div/p/b")
Expand Down

0 comments on commit 354c605

Please sign in to comment.