Misc 5 #67
|
@ -76,6 +76,7 @@ impl OwnerValidationError {
|
|||
indoc! {r#"
|
||||
Invalid {} name prefix: '{}' does not match your username or any of your groups.
|
||||
Are you sure you are allowed to create {} names with this prefix?
|
||||
The format should be: <prefix>_<{} name>
|
||||
|
||||
Allowed prefixes:
|
||||
- {}
|
||||
|
@ -84,6 +85,7 @@ impl OwnerValidationError {
|
|||
db_or_user.lowercased(),
|
||||
name,
|
||||
db_or_user.lowercased(),
|
||||
db_or_user.lowercased(),
|
||||
user.as_ref()
|
||||
.map(|u| u.username.clone())
|
||||
.unwrap_or("???".to_string()),
|
||||
|
|
|
@ -45,7 +45,7 @@ pub fn validate_ownership_by_prefixes(
|
|||
|
||||
if prefixes
|
||||
.iter()
|
||||
.filter(|p| name.starts_with(*p))
|
||||
.filter(|p| name.starts_with(&(p.to_string() + "_")))
|
||||
.collect::<Vec<_>>()
|
||||
.is_empty()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue