mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Fix a RuntimeWarning introduced in Django 5 (#29)
This commit is contained in:
@@ -6,6 +6,7 @@ from portal.models import SiteConfiguration, Flatpage
|
||||
|
||||
@admin.register(SiteConfiguration)
|
||||
class SiteConfigurationAdmin(SingletonModelAdmin):
|
||||
readonly_fields = ("site_name",)
|
||||
fieldsets = (
|
||||
(
|
||||
None,
|
||||
|
@@ -0,0 +1,16 @@
|
||||
# Generated by Django 5.0.1 on 2024-01-20 21:02
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("portal", "0015_siteconfiguration_use_cdn"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="siteconfiguration",
|
||||
name="site_name",
|
||||
),
|
||||
]
|
@@ -1,5 +1,6 @@
|
||||
import django
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from django.urls import reverse
|
||||
from django.dispatch.dispatcher import receiver
|
||||
from django.utils.safestring import mark_safe
|
||||
@@ -13,9 +14,6 @@ from ram.utils import slugify
|
||||
|
||||
|
||||
class SiteConfiguration(SingletonModel):
|
||||
site_name = models.CharField(
|
||||
max_length=256, default="Railroad Assets Manager"
|
||||
)
|
||||
site_author = models.CharField(max_length=256, blank=True)
|
||||
about = RichTextField(blank=True)
|
||||
items_per_page = models.CharField(
|
||||
@@ -44,6 +42,9 @@ class SiteConfiguration(SingletonModel):
|
||||
def __str__(self):
|
||||
return "Site Configuration"
|
||||
|
||||
def site_name(self):
|
||||
return settings.SITE_NAME
|
||||
|
||||
def version(self):
|
||||
return app_version
|
||||
|
||||
|
Reference in New Issue
Block a user