nixpkgs/pkgs/by-name/po/powerdns-admin/0005-Use-app-context-to-create-routes.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

28 lines
790 B
Diff

From 3eb1a408758b68543c73d5214b467c2905fbea2a Mon Sep 17 00:00:00 2001
From: Flakebi <flakebi@t-online.de>
Date: Sat, 2 Dec 2023 16:32:36 +0100
Subject: [PATCH 5/6] Use app context to create routes
Routes creates session database tables, so it needs a context.
---
powerdnsadmin/__init__.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/powerdnsadmin/__init__.py b/powerdnsadmin/__init__.py
index 653af33..bc6f7df 100755
--- a/powerdnsadmin/__init__.py
+++ b/powerdnsadmin/__init__.py
@@ -73,7 +73,8 @@ def create_app(config=None):
# Load app's components
assets.init_app(app)
models.init_app(app)
- routes.init_app(app)
+ with app.app_context():
+ routes.init_app(app)
services.init_app(app)
# Register filters
--
2.42.0