Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion alembic/README

This file was deleted.

2 changes: 1 addition & 1 deletion bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export FREENIT_ENV="test"


setup
pytest -v -rs --ignore=freenit/project/
pytest -v --ignore=freenit/project/
2 changes: 1 addition & 1 deletion freenit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.15"
__version__ = "0.3.16"
7 changes: 4 additions & 3 deletions freenit/cli.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import os
import pathlib
import subprocess

from prompt_toolkit import prompt
import sys


def main():
if len(sys.argv) != 2:
raise ValueError(f"Usage: {sys.argv[0]}: <project name>")
project_name = sys.argv[1]
path = pathlib.Path(__file__).parent.resolve()
project_name = prompt("Name of the project: ")
executable = f"{path}/../bin/freenit.sh"
if not os.path.exists(executable):
executable = f"{path}/bin/freenit.sh"
Expand Down
2 changes: 1 addition & 1 deletion freenit/models/ldap/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def get_all(cls, domain):
client = get_client()
try:
async with client.connect(is_async=True) as conn:
dn = config.ldap.groupBase.format(domain)
dn = config.ldap.roleBase.format(domain)
res = await conn.search(dn, LDAPSearchScope.SUB, f"(|{classes})")
data = []
for gdata in res:
Expand Down
3 changes: 2 additions & 1 deletion migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@


def db_setup():
importlib.import_module(f"{app_name}.app")
app = importlib.import_module(f"{app_name}.app")
command.upgrade(alembic_cfg, "head")
return app


if __name__ == "__main__":
Expand Down
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

7 changes: 2 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import importlib
import os

import pytest

from alembic import command
from alembic.config import Config
from name import app_name
from migrate import db_setup as dbs

from .client import Client

Expand All @@ -16,8 +14,7 @@

@pytest.fixture
def db_setup():
app = importlib.import_module(f"{app_name}.app")
command.upgrade(alembic_cfg, "head")
app = dbs()

yield app.app

Expand Down