Skip to content

Commit

Permalink
Move site notices to a seperate Django app
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelglenister committed Jan 10, 2022
1 parent b5a6969 commit cfaf53c
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 11 deletions.
4 changes: 0 additions & 4 deletions municipal_finance/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.contrib import admin
from django_q.tasks import async_task
from import_export.admin import ImportExportModelAdmin
from adminsortable.admin import SortableAdmin

from .models import (
MunicipalStaffContactsUpdate,
Expand All @@ -30,7 +29,6 @@
GrantTypesV2,
CapitalTypeV2,
DemarcationChanges,
SiteNotice,
)
from .resources import (
AgedDebtorItemsV2Resource,
Expand Down Expand Up @@ -204,5 +202,3 @@ class DemarcationChangesAdmin(admin.ModelAdmin):
"old_code_transition",
"new_code_transition",
)

admin.site.register(SiteNotice, SortableAdmin)
2 changes: 1 addition & 1 deletion municipal_finance/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from municipal_finance import models
from site_config import models


def google_analytics(request):
Expand Down
2 changes: 0 additions & 2 deletions municipal_finance/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@
)
from .demarcation_changes import DemarcationChanges

from .notice import SiteNotice


class AuditOpinionFacts(models.Model):
demarcation_code = models.TextField()
Expand Down
1 change: 1 addition & 0 deletions municipal_finance/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"infrastructure",
"household",
"webflow",
"site_config",
"django.contrib.sites",
"django.contrib.contenttypes",
"django.contrib.humanize",
Expand Down
Empty file added site_config/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions site_config/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin
from adminsortable.admin import SortableAdmin
from . import models

admin.site.register(models.SiteNotice, SortableAdmin)
5 changes: 5 additions & 0 deletions site_config/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class SiteConfigConfig(AppConfig):
name = 'site_config'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-01-03 14:47
# Generated by Django 1.11.29 on 2022-01-10 14:03
from __future__ import unicode_literals

import ckeditor.fields
Expand All @@ -8,8 +8,9 @@

class Migration(migrations.Migration):

initial = True

dependencies = [
('municipal_finance', '0040_auto_20210222_0541'),
]

operations = [
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions municipal_finance/models/notice.py → site_config/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.db import models
import ckeditor.fields as ckeditor_fields
from adminsortable.models import SortableMixin
from django.db import models


class SiteNotice(SortableMixin):
description = models.CharField(max_length=200)
Expand Down

0 comments on commit cfaf53c

Please sign in to comment.