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

[8593] organisations: add edit slug in admin #2930

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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