Skip to content

Commit

Permalink
organisations: add edit slug in admin
Browse files Browse the repository at this point in the history
Fixes #8593
  • Loading branch information
partizipation authored and goapunk committed Jan 20, 2025
1 parent ed68a88 commit 703c6e9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/organisations/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OrganisationAdmin(TranslatableAdmin):
MemberInline,
]
fieldsets = (
(None, {"fields": ("name", "initiators", "title")}),
(None, {"fields": ("name", "initiators", "title", "slug")}),
(
"Translations",
{
Expand Down
21 changes: 21 additions & 0 deletions apps/organisations/migrations/0025_alter_organisation_slug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.18 on 2025-01-20 15:20

import autoslug.fields
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("a4_candy_organisations", "0024_organisation_enable_geolocation"),
]

operations = [
migrations.AlterField(
model_name="organisation",
name="slug",
field=autoslug.fields.AutoSlugField(
editable=True, populate_from="name", unique=True
),
),
]
2 changes: 1 addition & 1 deletion apps/organisations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class Organisation(TranslatableModel):
slug = AutoSlugField(populate_from="name", unique=True)
slug = AutoSlugField(populate_from="name", unique=True, editable=True)
name = models.CharField(max_length=512)
initiators = models.ManyToManyField(settings.AUTH_USER_MODEL, blank=True)
title = models.CharField(
Expand Down
3 changes: 3 additions & 0 deletions changelog/8593.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Added

- admin users can edit slug in the organisation admin

0 comments on commit 703c6e9

Please sign in to comment.