Compare commits
5 commits
e5acfdf19d
...
375fcbb2c7
| Author | SHA1 | Date | |
|---|---|---|---|
| 375fcbb2c7 | |||
| 5843c551b1 | |||
| 1884ac1d43 | |||
| a5e2fee7a9 | |||
| 433d030539 |
5 changed files with 71 additions and 55 deletions
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -2,16 +2,16 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1758070117,
|
||||
"narHash": "sha256-uLwwHFCZnT1c3N3biVe/0hCkag2GSrf9+M56+Okf+WY=",
|
||||
"lastModified": 1773222311,
|
||||
"narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e9b7f2ff62b35f711568b1f0866243c7c302028d",
|
||||
"rev": "0590cd39f728e129122770c029970378a79d076a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-25.05",
|
||||
"ref": "nixos-25.11",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
description = "Invoiceplane invoice template development shell";
|
||||
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-25.05";
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-25.11";
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, ... }@inputs:
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
system.stateVersion = "25.11";
|
||||
services.getty.autologinUser = "root";
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ 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
|
||||
|
|
@ -169,9 +167,9 @@ in
|
|||
systemd = {
|
||||
services = {
|
||||
|
||||
postgresql.serviceConfig.ExecStartPost =
|
||||
postgresql-setup.serviceConfig.ExecStartPost =
|
||||
let
|
||||
sqlFile = pkgs.writeText "immich-pgvectors-setup.sql" ''
|
||||
sqlFile = pkgs.writeText "froide-govplan-postgis-setup.sql" ''
|
||||
CREATE EXTENSION IF NOT EXISTS postgis;
|
||||
'';
|
||||
in
|
||||
|
|
@ -190,14 +188,15 @@ in
|
|||
Group = "govplan";
|
||||
};
|
||||
after = [
|
||||
"postgresql.service"
|
||||
"postgresql.target"
|
||||
"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
|
||||
|
|
@ -226,7 +225,8 @@ in
|
|||
psycopg
|
||||
mastodon-py
|
||||
(toPythonModule (pkg))
|
||||
]);
|
||||
]
|
||||
);
|
||||
GDAL_LIBRARY_PATH = "${pkgs.gdal}/lib/libgdal.so";
|
||||
GEOS_LIBRARY_PATH = "${pkgs.geos}/lib/libgeos_c.so";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,17 +2,21 @@ 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
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ 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(
|
||||
|
|
@ -41,9 +45,17 @@ 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",
|
||||
),
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue