upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/git/authorization.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/git/authorization.rs')
-rw-r--r--src/git/authorization.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/git/authorization.rs b/src/git/authorization.rs
index 0e9a8ba..bf49800 100644
--- a/src/git/authorization.rs
+++ b/src/git/authorization.rs
@@ -234,7 +234,7 @@ pub struct RepositoryData {
234/// 234///
235/// This performs a single database query to fetch both announcement and state events, 235/// This performs a single database query to fetch both announcement and state events,
236/// which is more efficient than separate queries. 236/// which is more efficient than separate queries.
237pub async fn fetch_repository_data( 237pub async fn fetch_repository_data_excluding_purgatory(
238 database: &SharedDatabase, 238 database: &SharedDatabase,
239 identifier: &str, 239 identifier: &str,
240) -> Result<RepositoryData> { 240) -> Result<RepositoryData> {
@@ -298,7 +298,7 @@ pub async fn fetch_repository_data_with_purgatory(
298 identifier: &str, 298 identifier: &str,
299) -> Result<RepositoryData> { 299) -> Result<RepositoryData> {
300 // First, fetch from database 300 // First, fetch from database
301 let mut repo_data = fetch_repository_data(database, identifier).await?; 301 let mut repo_data = fetch_repository_data_excluding_purgatory(database, identifier).await?;
302 302
303 // Then, add announcements from purgatory 303 // Then, add announcements from purgatory
304 let purgatory_announcements = purgatory.get_announcements_by_identifier(identifier); 304 let purgatory_announcements = purgatory.get_announcements_by_identifier(identifier);
@@ -511,7 +511,7 @@ pub async fn get_authorization_from_db(
511 identifier: &str, 511 identifier: &str,
512) -> Result<AuthorizationResult> { 512) -> Result<AuthorizationResult> {
513 // Fetch all repository data with a single query 513 // Fetch all repository data with a single query
514 let repo_data = fetch_repository_data(database, identifier).await?; 514 let repo_data = fetch_repository_data_excluding_purgatory(database, identifier).await?;
515 515
516 if repo_data.announcements.is_empty() { 516 if repo_data.announcements.is_empty() {
517 return Ok(AuthorizationResult::denied( 517 return Ok(AuthorizationResult::denied(