Compare commits

..

No commits in common. "375fcbb2c74110b013370a5ba360a319ff9d3bf9" and "e5acfdf19d5af71bc5223c72713c128f3948f39f" have entirely different histories.

5 changed files with 55 additions and 71 deletions

8
flake.lock generated
View file

@ -2,16 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1773222311,
"narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=",
"lastModified": 1758070117,
"narHash": "sha256-uLwwHFCZnT1c3N3biVe/0hCkag2GSrf9+M56+Okf+WY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0590cd39f728e129122770c029970378a79d076a",
"rev": "e9b7f2ff62b35f711568b1f0866243c7c302028d",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-25.11",
"ref": "nixos-25.05",
"type": "indirect"
}
},

View file

@ -1,7 +1,7 @@
{
description = "Invoiceplane invoice template development shell";
inputs.nixpkgs.url = "nixpkgs/nixos-25.11";
inputs.nixpkgs.url = "nixpkgs/nixos-25.05";
outputs =
{ self, nixpkgs, ... }@inputs:
@ -77,7 +77,7 @@
};
};
system.stateVersion = "25.11";
system.stateVersion = "25.05";
services.getty.autologinUser = "root";
}
)

View file

@ -13,7 +13,9 @@ let
pkg = cfg.package.overridePythonAttrs (old: {
src = ./.;
dependencies = old.dependencies ++ [ cfg.package.python.pkgs.mastodon-py ];
postInstall = old.postInstall + ''
postInstall =
old.postInstall
+ ''
ln -s ${settingsFile} $out/${pkg.python.sitePackages}/froide_govplan/project/extra_settings.py
rm -r $out/${pkgs.python3.sitePackages}/froide_govplan/templates
@ -167,9 +169,9 @@ in
systemd = {
services = {
postgresql-setup.serviceConfig.ExecStartPost =
postgresql.serviceConfig.ExecStartPost =
let
sqlFile = pkgs.writeText "froide-govplan-postgis-setup.sql" ''
sqlFile = pkgs.writeText "immich-pgvectors-setup.sql" ''
CREATE EXTENSION IF NOT EXISTS postgis;
'';
in
@ -188,15 +190,14 @@ in
Group = "govplan";
};
after = [
"postgresql.target"
"postgresql.service"
"network.target"
"systemd-tmpfiles-setup.service"
];
wantedBy = [ "multi-user.target" ];
environment = {
PYTHONPATH = pkg.python.pkgs.makePythonPath (
with pkg.python.pkgs;
[
environment =
{
PYTHONPATH = pkg.python.pkgs.makePythonPath (with pkg.python.pkgs; [
bleach
django-admin-sortable2
@ -225,8 +226,7 @@ in
psycopg
mastodon-py
(toPythonModule (pkg))
]
);
]);
GDAL_LIBRARY_PATH = "${pkgs.gdal}/lib/libgdal.so";
GEOS_LIBRARY_PATH = "${pkgs.geos}/lib/libgeos_c.so";
}

View file

@ -2,21 +2,17 @@ from django.db.models.signals import post_save
from django.dispatch import receiver
from django.conf import settings
from django.db import transaction
from mastodon import Mastodon
from .models import GovernmentPlanUpdate, GovernmentPlan
import re
import html
if not settings.DEBUG:
from mastodon import Mastodon
def strip_html_tags(text):
tag_re = re.compile(r'<[^>]+>')
plain_text = tag_re.sub('', text)
return html.unescape(plain_text)
def post_to_mastodon(text):
if settings.DEBUG:
return
mastodon = Mastodon(
access_token=settings.MASTODON_ACCESS_TOKEN,
api_base_url=settings.MASTODON_API_BASE_URL

View file

@ -29,10 +29,6 @@ urlpatterns = [
path(
pgettext_lazy("url part", "<slug:gov>/plan/<slug:plan>/"),
GovPlanDetailView.as_view(),
),
path(
pgettext_lazy("url part", "<slug:gov>/plan/<slug:plan>"),
GovPlanDetailView.as_view(),
name="plan",
),
path(
@ -45,17 +41,9 @@ urlpatterns = [
GovPlanProposeUpdateView.as_view(),
name="propose_planupdate",
),
path(
pgettext_lazy("url part", "<slug:gov>/vorhaben/<slug:plan>"),
GovPlanDetailView.as_view(),
),
path(
pgettext_lazy("url part", "<slug:gov>/<slug:section>/"),
GovPlanSectionDetailView.as_view(),
),
path(
pgettext_lazy("url part", "<slug:gov>/<slug:section>"),
GovPlanSectionDetailView.as_view(),
name="section",
),
]