diff --git a/club/models.py b/club/models.py
index 408090b2..2c5b5ff0 100644
--- a/club/models.py
+++ b/club/models.py
@@ -240,7 +240,7 @@ class Club(models.Model):
def can_roles_be_edited_by(self, user: User) -> bool:
"""Return True if the given user can edit the roles of this club"""
- return (
+ return user.is_authenticated and (
user.has_perm("club.change_clubrole")
or self.members.ongoing().filter(user=user, role__is_presidency=True).exists()
)
diff --git a/club/static/bundled/club/role-list-index.ts b/club/static/bundled/club/role-list-index.ts
index a750501a..2020bba4 100644
--- a/club/static/bundled/club/role-list-index.ts
+++ b/club/static/bundled/club/role-list-index.ts
@@ -3,16 +3,22 @@ import type { AlpineComponent } from "alpinejs";
interface RoleGroupData {
isBoard: boolean;
isPresidency: boolean;
+ roleId: number;
}
document.addEventListener("alpine:init", () => {
- Alpine.data("clubRoleList", () => ({
+ Alpine.data("clubRoleList", (config: { userRoleId: number | null }) => ({
+ confirmOnSubmit: false,
+
/**
* Edit relevant item data after it has been moved by x-sort
*/
reorder(item: AlpineComponent