Skip to content

Commit

Permalink
apps/modules: change module blueprint_type to char
Browse files Browse the repository at this point in the history
  • Loading branch information
goapunk committed Dec 4, 2023
1 parent 108472a commit ba29c80
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 42 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@ lint:
$(VIRTUAL_ENV)/bin/isort --diff -c $(SOURCE_DIRS) || EXIT_STATUS=$$?; \
$(VIRTUAL_ENV)/bin/flake8 $(SOURCE_DIRS) --exclude migrations,settings || EXIT_STATUS=$$?; \
npm run lint || EXIT_STATUS=$$?; \
$(VIRTUAL_ENV)/bin/python manage.py makemigrations --dry-run --check --noinput || EXIT_STATUS=$$?; \
exit $${EXIT_STATUS}

.PHONY: lint-quick
lint-quick:
EXIT_STATUS=0; \
npm run lint-staged || EXIT_STATUS=$$?; \
$(VIRTUAL_ENV)/bin/python manage.py makemigrations --dry-run --check --noinput || EXIT_STATUS=$$?; \
exit $${EXIT_STATUS}

.PHONY: lint-python-files
lint-python-files:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.0 on 2023-11-07 15:26
# Generated by Django 4.2 on 2023-11-29 12:49

from django.db import migrations, models
import django.db.models.deletion
Expand Down
1 change: 1 addition & 0 deletions adhocracy4/modules/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ItemAdmin(admin.ModelAdmin):

class ModuleAdmin(admin.ModelAdmin):
inlines = [phase_admin.PhaseInline]
search_fields = ["name"]
list_filter = ("project__organisation", "project")
list_display = ("__str__", "name")
if hasattr(settings, "A4_BLUEPRINT_TYPES"):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 4.0 on 2023-11-07 15:26
# Generated by Django 4.2 on 2023-11-29 12:49

import adhocracy4.modules.fields
from django.db import migrations
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -13,8 +12,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="module",
name="blueprint_type",
field=adhocracy4.modules.fields.BlueprintTypeField(
blank=True, choices=[], max_length=255
),
field=models.CharField(blank=True, max_length=255),
),
]
4 changes: 1 addition & 3 deletions adhocracy4/modules/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from adhocracy4.models import base
from adhocracy4.projects import models as project_models

from .fields import BlueprintTypeField


class ModulesQuerySet(models.QuerySet):
def annotate_module_start(self):
Expand Down Expand Up @@ -95,7 +93,7 @@ class Module(models.Model):

objects = ModulesQuerySet.as_manager()

blueprint_type = BlueprintTypeField(
blueprint_type = models.CharField(
max_length=255,
blank=True,
)
Expand Down
28 changes: 0 additions & 28 deletions adhocracy4/projects/migrations/0042_alter_project_topics.py

This file was deleted.

3 changes: 3 additions & 0 deletions changelog/0005.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changed

- apps/modules: change blueprint_type to char field (was creating migrations in forked projects after django upgrade to 4.x)

0 comments on commit ba29c80

Please sign in to comment.