Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make group name unique #867

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open

Conversation

Isti01
Copy link
Collaborator

@Isti01 Isti01 commented Feb 12, 2025

No description provided.

@Isti01 Isti01 requested a review from Gerviba February 12, 2025 21:24
@Isti01
Copy link
Collaborator Author

Isti01 commented Feb 12, 2025

@Gerviba what do you think, can we do this?

@Isti01 Isti01 requested a review from SzBeni2003 February 13, 2025 10:57
@Gerviba
Copy link
Member

Gerviba commented Feb 22, 2025

@Isti01 it will most likely work, but I'd add sg. like:

    override fun onEntityPreSave(entity: GroupEntity, auth: Authentication): Boolean {
        while (actualEntity.name is not unique) {
            actualEntity.name += "2"
        }
        return true
    }

to the GroupController

@Isti01
Copy link
Collaborator Author

Isti01 commented Mar 4, 2025

@Isti01 it will most likely work, but I'd add sg. like:

    override fun onEntityPreSave(entity: GroupEntity, auth: Authentication): Boolean {
        while (actualEntity.name is not unique) {
            actualEntity.name += "2"
        }
        return true
    }

to the GroupController

Oh, I see. When I thought through this, I got the conclusion that it's fine to get an error if you try to insert a group with the same name. Because it would only appear in the admin panel. The team creation api already checks for name collisions

@Gerviba
Copy link
Member

Gerviba commented Mar 8, 2025

@Isti01 it will most likely work, but I'd add sg. like:

    override fun onEntityPreSave(entity: GroupEntity, auth: Authentication): Boolean {
        while (actualEntity.name is not unique) {
            actualEntity.name += "2"
        }
        return true
    }

to the GroupController

Oh, I see. When I thought through this, I got the conclusion that it's fine to get an error if you try to insert a group with the same name. Because it would only appear in the admin panel. The team creation api already checks for name collisions

I'd only do this with groups since event organisers regularly use this feature. But it is up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants