diff --git a/CHANGELOG.md b/CHANGELOG.md index bce9955c..0cb79e1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ please submit a pull request fixing it. - Fixed bug in rendering of registration form. ([#222]) - User profile OGP tags ([#228]) - Added Spring 2022 RCOS proposal ([#240]) +- Updated minimum rust version to 1.58.1. +- Fixed bug that missed verified role on users already in the RCOS Discord. ([#236], [#242]) ## 0.8.5 - December 31st, 2021 - Changes to the config file: @@ -178,4 +180,6 @@ please submit a pull request fixing it. [#220]: https://github.com/rcos/Telescope/pull/220 [#222]: https://github.com/rcos/Telescope/pull/222 [#228]: https://github.com/rcos/Telescope/pull/228 +[#236]: https://github.com/rcos/Telescope/issues/236 [#240]: https://github.com/rcos/Telescope/pull/240 +[#242]: https://github.com/rcos/Telescope/pull/242 diff --git a/Cargo.toml b/Cargo.toml index 613046fa..99a9c5cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.8.6-dev" authors = ["Antonia \"Nia\" Calia-Bogan "] description = "The RCOS webapp" edition = "2021" -rust-version = "1.57" +rust-version = "1.58.1" [dependencies] # command line argument parser diff --git a/Dockerfile b/Dockerfile index 90bedcfc..cf9cd25a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use latest rust (by explicit version to avoid getting a stale release) -FROM rust:1.57 +FROM rust:1.58.1 # Set timezone ENV TZ=America/New_York diff --git a/src/discord_bot/commands/whois.rs b/src/discord_bot/commands/whois.rs index 5d4e5057..15b4240d 100644 --- a/src/discord_bot/commands/whois.rs +++ b/src/discord_bot/commands/whois.rs @@ -136,11 +136,7 @@ async fn handle(ctx: &Context, interaction: &ApplicationCommandInteraction) -> S // Title with the user's name .title(format!("{} {}", u.first_name, u.last_name)) // Link to their profile - .url(format!( - "{}/user/{}", - global_config().telescope_url, - u.id - )) + .url(format!("{}/user/{}", global_config().telescope_url, u.id)) // List their role inline .field("User Role", u.role, true); diff --git a/src/env.rs b/src/env.rs index 921444ba..82c9cd30 100644 --- a/src/env.rs +++ b/src/env.rs @@ -131,7 +131,7 @@ impl TelescopeConfig { .expect("Could not resolve JWT secret."), telescope_url: self .reverse_lookup(profile_slice, |c| c.telescope_url.clone()) - .expect("Could not resolve Telescope URl.") + .expect("Could not resolve Telescope URl."), } } diff --git a/src/web/services/auth/oauth2_providers/discord.rs b/src/web/services/auth/oauth2_providers/discord.rs index b3c90170..6f2f0479 100644 --- a/src/web/services/auth/oauth2_providers/discord.rs +++ b/src/web/services/auth/oauth2_providers/discord.rs @@ -190,7 +190,7 @@ impl DiscordIdentity { }); } - /// Add this user to the RCOS Discord. Set their nickname and give them the "Verified" role. + /// Add this user to the RCOS Discord. Set their nickname and give them the specified roles. pub async fn add_to_rcos_guild( &self, nickname: Option, diff --git a/src/web/services/meetings/edit.rs b/src/web/services/meetings/edit.rs index 1af95449..27288143 100644 --- a/src/web/services/meetings/edit.rs +++ b/src/web/services/meetings/edit.rs @@ -95,13 +95,13 @@ fn resolve_host_user_id( ) -> Option { match set_host { // If there is a specified nil UUID we want no host. Otherwise, we want the specified UUID. - Some(Query(HostQuery{ set_host })) => { + Some(Query(HostQuery { set_host })) => { if set_host.is_nil() { None } else { Some(set_host) } - }, + } // If there is no host query then use the existing host parameter (which may be none). None => meeting_data.host.as_ref().map(|h| h.id), diff --git a/src/web/services/user/join_discord.rs b/src/web/services/user/join_discord.rs index a51d947f..781106cd 100644 --- a/src/web/services/user/join_discord.rs +++ b/src/web/services/user/join_discord.rs @@ -1,12 +1,14 @@ //! Page and service to let users into RCOS Discord and give them the verified role. -use crate::api::discord::rcos_discord_verified_role_id; +use crate::api::discord::{global_discord_client, rcos_discord_verified_role_id}; use crate::api::rcos::users::discord_whois::DiscordWhoIs; use crate::error::TelescopeError; +use crate::env::global_config; use crate::web::services::auth::identity::AuthenticationCookie; use actix_web::HttpResponse; use reqwest::header::LOCATION; +use serenity::model::prelude::RoleId; /// Let users into the RCOS discord. #[get("/join_discord")] @@ -86,13 +88,28 @@ pub async fn handle(auth: AuthenticationCookie) -> Result year { - form["issues"]["cohort"] = json!( - format!("Year must be between 1824 and {}", year) - ); + form["issues"]["cohort"] = json!(format!("Year must be between 1824 and {}", year)); } }