~swalladge/auslan-directory

2d83818ded9399c612bc1ee9433400c3c65e51b6 — Samuel Walladge 5 months ago a047869
Don't allow `+` in tag names

This could be confusing, when `+` is used as the standard tag prefix.
1 files changed, 4 insertions(+), 0 deletions(-)

M src/views/editor_views.rs
M src/views/editor_views.rs => src/views/editor_views.rs +4 -0
@@ 216,6 216,8 @@ pub(crate) async fn tag_editor_action(

    if data.name.trim().split_whitespace().count() > 1 {
        err = Some("tag name may not contain whitespace".to_owned());
    } else if data.name.contains('+') {
        err = Some("tag name may not contain a plus sign (+)".to_owned());
    } else {
        db::update_tag(
            pool.inner(),


@@ 257,6 259,8 @@ pub(crate) async fn new_tag_action(

    if data.name.trim().split_whitespace().count() > 1 {
        err = Some("tag name may not contain whitespace".to_owned());
    } else if data.name.contains('+') {
        err = Some("tag name may not contain a plus sign (+)".to_owned());
    } else {
        match db::create_tag(
            pool.inner(),