aboutsummaryrefslogtreecommitdiffstats
path: root/src/handlers.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-26 00:48:53 +0300
committerYigit Sever2021-04-26 00:48:53 +0300
commit820a0a600cb8fe2432374a3691e76940f6726044 (patch)
tree2098af9419b939bb473ee8d04e3d82e69f63556c /src/handlers.rs
parent79bf06e291a8fc12b61022068f5a231bea032113 (diff)
downloadgradecoin-820a0a600cb8fe2432374a3691e76940f6726044.tar.gz
gradecoin-820a0a600cb8fe2432374a3691e76940f6726044.tar.bz2
gradecoin-820a0a600cb8fe2432374a3691e76940f6726044.zip
Bugfix
Diffstat (limited to 'src/handlers.rs')
-rw-r--r--src/handlers.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/handlers.rs b/src/handlers.rs
index e37cb40..ed95604 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -646,6 +646,18 @@ pub async fn propose_transaction(
646 } 646 }
647 }; 647 };
648 648
649 if internal_user.is_bot {
650 debug!("Someone tried to send as the bot");
651
652 return Ok(warp::reply::with_status(
653 warp::reply::json(&GradeCoinResponse {
654 res: ResponseType::Error,
655 message: "Don's send transactions on behalf of bots".to_owned(),
656 }),
657 StatusCode::BAD_REQUEST,
658 ));
659 }
660
649 // `internal_user` is an authenticated student, can propose 661 // `internal_user` is an authenticated student, can propose
650 662
651 // This public key was already written to the database, we can panic if it's not valid at 663 // This public key was already written to the database, we can panic if it's not valid at