mirror of
https://github.com/LemmyNet/lemmy
synced 2024-12-03 17:59:47 +00:00
Edit community name validation, translations #823
This commit is contained in:
parent
4247df4295
commit
8e1e9a521a
2 changed files with 5 additions and 0 deletions
|
@ -311,6 +311,10 @@ impl Perform for Oper<EditCommunity> {
|
||||||
Err(_e) => return Err(APIError::err("not_logged_in").into()),
|
Err(_e) => return Err(APIError::err("not_logged_in").into()),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if !is_valid_community_name(&data.name) {
|
||||||
|
return Err(APIError::err("invalid_community_name").into());
|
||||||
|
}
|
||||||
|
|
||||||
let user_id = claims.id;
|
let user_id = claims.id;
|
||||||
|
|
||||||
let conn = pool.get()?;
|
let conn = pool.get()?;
|
||||||
|
|
1
ui/translations/en.json
vendored
1
ui/translations/en.json
vendored
|
@ -27,6 +27,7 @@
|
||||||
"number_of_communities": "{{count}} Community",
|
"number_of_communities": "{{count}} Community",
|
||||||
"number_of_communities_plural": "{{count}} Communities",
|
"number_of_communities_plural": "{{count}} Communities",
|
||||||
"community_reqs": "lowercase, underscores, and no spaces.",
|
"community_reqs": "lowercase, underscores, and no spaces.",
|
||||||
|
"invalid_community_name": "Invalid name.",
|
||||||
"create_private_message": "Create Private Message",
|
"create_private_message": "Create Private Message",
|
||||||
"send_secure_message": "Send Secure Message",
|
"send_secure_message": "Send Secure Message",
|
||||||
"send_message": "Send Message",
|
"send_message": "Send Message",
|
||||||
|
|
Loading…
Reference in a new issue