Compare commits
No commits in common. "375fcbb2c74110b013370a5ba360a319ff9d3bf9" and "e5acfdf19d5af71bc5223c72713c128f3948f39f" have entirely different histories.
375fcbb2c7
...
e5acfdf19d
5 changed files with 55 additions and 71 deletions
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -2,16 +2,16 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773222311,
|
"lastModified": 1758070117,
|
||||||
"narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=",
|
"narHash": "sha256-uLwwHFCZnT1c3N3biVe/0hCkag2GSrf9+M56+Okf+WY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "0590cd39f728e129122770c029970378a79d076a",
|
"rev": "e9b7f2ff62b35f711568b1f0866243c7c302028d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-25.11",
|
"ref": "nixos-25.05",
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
description = "Invoiceplane invoice template development shell";
|
description = "Invoiceplane invoice template development shell";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "nixpkgs/nixos-25.11";
|
inputs.nixpkgs.url = "nixpkgs/nixos-25.05";
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{ self, nixpkgs, ... }@inputs:
|
{ self, nixpkgs, ... }@inputs:
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "25.11";
|
system.stateVersion = "25.05";
|
||||||
services.getty.autologinUser = "root";
|
services.getty.autologinUser = "root";
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,9 @@ let
|
||||||
pkg = cfg.package.overridePythonAttrs (old: {
|
pkg = cfg.package.overridePythonAttrs (old: {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
dependencies = old.dependencies ++ [ cfg.package.python.pkgs.mastodon-py ];
|
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
|
ln -s ${settingsFile} $out/${pkg.python.sitePackages}/froide_govplan/project/extra_settings.py
|
||||||
|
|
||||||
rm -r $out/${pkgs.python3.sitePackages}/froide_govplan/templates
|
rm -r $out/${pkgs.python3.sitePackages}/froide_govplan/templates
|
||||||
|
|
@ -167,9 +169,9 @@ in
|
||||||
systemd = {
|
systemd = {
|
||||||
services = {
|
services = {
|
||||||
|
|
||||||
postgresql-setup.serviceConfig.ExecStartPost =
|
postgresql.serviceConfig.ExecStartPost =
|
||||||
let
|
let
|
||||||
sqlFile = pkgs.writeText "froide-govplan-postgis-setup.sql" ''
|
sqlFile = pkgs.writeText "immich-pgvectors-setup.sql" ''
|
||||||
CREATE EXTENSION IF NOT EXISTS postgis;
|
CREATE EXTENSION IF NOT EXISTS postgis;
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
|
|
@ -188,15 +190,14 @@ in
|
||||||
Group = "govplan";
|
Group = "govplan";
|
||||||
};
|
};
|
||||||
after = [
|
after = [
|
||||||
"postgresql.target"
|
"postgresql.service"
|
||||||
"network.target"
|
"network.target"
|
||||||
"systemd-tmpfiles-setup.service"
|
"systemd-tmpfiles-setup.service"
|
||||||
];
|
];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
environment = {
|
environment =
|
||||||
PYTHONPATH = pkg.python.pkgs.makePythonPath (
|
{
|
||||||
with pkg.python.pkgs;
|
PYTHONPATH = pkg.python.pkgs.makePythonPath (with pkg.python.pkgs; [
|
||||||
[
|
|
||||||
|
|
||||||
bleach
|
bleach
|
||||||
django-admin-sortable2
|
django-admin-sortable2
|
||||||
|
|
@ -225,8 +226,7 @@ in
|
||||||
psycopg
|
psycopg
|
||||||
mastodon-py
|
mastodon-py
|
||||||
(toPythonModule (pkg))
|
(toPythonModule (pkg))
|
||||||
]
|
]);
|
||||||
);
|
|
||||||
GDAL_LIBRARY_PATH = "${pkgs.gdal}/lib/libgdal.so";
|
GDAL_LIBRARY_PATH = "${pkgs.gdal}/lib/libgdal.so";
|
||||||
GEOS_LIBRARY_PATH = "${pkgs.geos}/lib/libgeos_c.so";
|
GEOS_LIBRARY_PATH = "${pkgs.geos}/lib/libgeos_c.so";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,17 @@ from django.db.models.signals import post_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
from mastodon import Mastodon
|
||||||
from .models import GovernmentPlanUpdate, GovernmentPlan
|
from .models import GovernmentPlanUpdate, GovernmentPlan
|
||||||
import re
|
import re
|
||||||
import html
|
import html
|
||||||
|
|
||||||
if not settings.DEBUG:
|
|
||||||
from mastodon import Mastodon
|
|
||||||
|
|
||||||
def strip_html_tags(text):
|
def strip_html_tags(text):
|
||||||
tag_re = re.compile(r'<[^>]+>')
|
tag_re = re.compile(r'<[^>]+>')
|
||||||
plain_text = tag_re.sub('', text)
|
plain_text = tag_re.sub('', text)
|
||||||
return html.unescape(plain_text)
|
return html.unescape(plain_text)
|
||||||
|
|
||||||
def post_to_mastodon(text):
|
def post_to_mastodon(text):
|
||||||
if settings.DEBUG:
|
|
||||||
return
|
|
||||||
mastodon = Mastodon(
|
mastodon = Mastodon(
|
||||||
access_token=settings.MASTODON_ACCESS_TOKEN,
|
access_token=settings.MASTODON_ACCESS_TOKEN,
|
||||||
api_base_url=settings.MASTODON_API_BASE_URL
|
api_base_url=settings.MASTODON_API_BASE_URL
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,6 @@ urlpatterns = [
|
||||||
path(
|
path(
|
||||||
pgettext_lazy("url part", "<slug:gov>/plan/<slug:plan>/"),
|
pgettext_lazy("url part", "<slug:gov>/plan/<slug:plan>/"),
|
||||||
GovPlanDetailView.as_view(),
|
GovPlanDetailView.as_view(),
|
||||||
),
|
|
||||||
path(
|
|
||||||
pgettext_lazy("url part", "<slug:gov>/plan/<slug:plan>"),
|
|
||||||
GovPlanDetailView.as_view(),
|
|
||||||
name="plan",
|
name="plan",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
|
|
@ -45,17 +41,9 @@ urlpatterns = [
|
||||||
GovPlanProposeUpdateView.as_view(),
|
GovPlanProposeUpdateView.as_view(),
|
||||||
name="propose_planupdate",
|
name="propose_planupdate",
|
||||||
),
|
),
|
||||||
path(
|
|
||||||
pgettext_lazy("url part", "<slug:gov>/vorhaben/<slug:plan>"),
|
|
||||||
GovPlanDetailView.as_view(),
|
|
||||||
),
|
|
||||||
path(
|
path(
|
||||||
pgettext_lazy("url part", "<slug:gov>/<slug:section>/"),
|
pgettext_lazy("url part", "<slug:gov>/<slug:section>/"),
|
||||||
GovPlanSectionDetailView.as_view(),
|
GovPlanSectionDetailView.as_view(),
|
||||||
),
|
|
||||||
path(
|
|
||||||
pgettext_lazy("url part", "<slug:gov>/<slug:section>"),
|
|
||||||
GovPlanSectionDetailView.as_view(),
|
|
||||||
name="section",
|
name="section",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue