tangled
alpha
login
or
join now
smokesignal.events
/
smokesignal
51
fork
atom
The smokesignal.events web application
51
fork
atom
overview
issues
7
pulls
pipelines
bug: language case caused missing template
Nick Gerakines
1 month ago
8cc15145
52ab35d7
+29
-8
2 changed files
expand all
collapse all
unified
split
src
http
handle_admin_tap.rs
handle_share_rsvp_bluesky.rs
+18
-3
src/http/handle_admin_tap.rs
···
134
134
path: &str,
135
135
) -> Option<T> {
136
136
let url = format!("{}{}", base_url, path);
137
137
-
match client.get(&url).timeout(Duration::from_secs(30)).send().await {
137
137
+
match client
138
138
+
.get(&url)
139
139
+
.timeout(Duration::from_secs(30))
140
140
+
.send()
141
141
+
.await
142
142
+
{
138
143
Ok(response) if response.status().is_success() => response.json::<T>().await.ok(),
139
144
Ok(response) => {
140
145
tracing::debug!(url = %url, status = %response.status(), "TAP stats request failed");
···
177
182
let subject = form.subject.trim();
178
183
179
184
// Resolve the subject (handle or DID) to a DID
180
180
-
let document = match admin_ctx.web_context.identity_resolver.resolve(subject).await {
185
185
+
let document = match admin_ctx
186
186
+
.web_context
187
187
+
.identity_resolver
188
188
+
.resolve(subject)
189
189
+
.await
190
190
+
{
181
191
Ok(doc) => doc,
182
192
Err(err) => {
183
193
return contextual_error!(
···
302
312
let subject = form.subject.trim();
303
313
304
314
// Resolve the subject (handle or DID) to a DID
305
305
-
let document = match admin_ctx.web_context.identity_resolver.resolve(subject).await {
315
315
+
let document = match admin_ctx
316
316
+
.web_context
317
317
+
.identity_resolver
318
318
+
.resolve(subject)
319
319
+
.await
320
320
+
{
306
321
Ok(doc) => doc,
307
322
Err(err) => {
308
323
return contextual_error!(
+11
-5
src/http/handle_share_rsvp_bluesky.rs
···
21
21
},
22
22
storage::event::{event_get, extract_event_details, rsvp_get_by_event_and_did},
23
23
};
24
24
-
use atproto_client::com::atproto::repo::{CreateRecordRequest, CreateRecordResponse, create_record};
24
24
+
use atproto_client::com::atproto::repo::{
25
25
+
CreateRecordRequest, CreateRecordResponse, create_record,
26
26
+
};
25
27
26
28
#[derive(Deserialize)]
27
29
pub(crate) struct ShareRsvpBlueskyRequest {
···
38
40
let current_handle = auth.require("/rsvp")?;
39
41
let session = auth.session().ok_or(CommonError::NotAuthorized)?;
40
42
41
41
-
let render_template = format!("{}/share_rsvp_bluesky.partial.html", language);
43
43
+
let render_template = format!(
44
44
+
"{}/share_rsvp_bluesky.partial.html",
45
45
+
language.to_string().to_lowercase()
46
46
+
);
42
47
43
48
// Fetch event details
44
49
let event = event_get(&web_context.pool, &request.event_aturi)
···
48
53
})?;
49
54
50
55
// Verify the user has a "going" RSVP to this event
51
51
-
let rsvp = rsvp_get_by_event_and_did(&web_context.pool, &request.event_aturi, ¤t_handle.did)
52
52
-
.await?
53
53
-
.ok_or(ShareBlueskyError::NoGoingRsvp)?;
56
56
+
let rsvp =
57
57
+
rsvp_get_by_event_and_did(&web_context.pool, &request.event_aturi, ¤t_handle.did)
58
58
+
.await?
59
59
+
.ok_or(ShareBlueskyError::NoGoingRsvp)?;
54
60
55
61
if rsvp.status != "going" {
56
62
return Err(ShareBlueskyError::NoGoingRsvp.into());