Skip to content

Commit a16b4ec

Browse files
authored
Merge pull request #40 from livestreamx/fix-cringe
FIX CRINGE
2 parents 083b19e + 69fd03f commit a16b4ec

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

overhave/admin/views/emulation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ def edit_view(self) -> werkzeug.Response | None:
8080
return rendered
8181

8282
test_user_id = data["test_user"]
83-
if not self._ensure_no_active_emulation_runs_for_user(int(test_user_id)):
83+
if self._ensure_has_active_emulation_runs_for_user(int(test_user_id)):
8484
flask.flash(f"Unable to run new emulation in parallel for user {test_user_id}")
8585
return rendered
8686

8787
logger.debug("Seen emulation request")
8888
return self._run_emulation(emulation_id)
8989

9090
@staticmethod
91-
def _ensure_no_active_emulation_runs_for_user(test_user_id: int) -> bool:
91+
def _ensure_has_active_emulation_runs_for_user(test_user_id: int) -> bool:
9292
factory = get_admin_factory()
9393
return factory.emulation_storage.has_running_emulation_with_user(test_user_id)

overhave/admin/views/scenario_test_run.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,11 @@ def on_model_delete(self, model: db.TestRun) -> None:
7171

7272
@staticmethod
7373
def _run_test(rendered: werkzeug.Response) -> werkzeug.Response:
74-
current_test_run_id = get_mdict_item_or_list(flask.request.args, "id")
74+
current_scenario_id = int(get_mdict_item_or_list(flask.request.args, "id"))
7575
factory = get_admin_factory()
76-
77-
with db.create_session() as session:
78-
scenario_id = (
79-
session.query(db.TestRun.scenario_id).filter(db.TestRun.id == current_test_run_id).one().scenario_id
80-
)
81-
82-
test_run_id = factory.test_run_storage.create_testrun(scenario_id=scenario_id, executed_by=current_user.login)
76+
test_run_id = factory.test_run_storage.create_testrun(
77+
scenario_id=current_scenario_id, executed_by=current_user.login
78+
)
8379

8480
if not factory.context.admin_settings.consumer_based:
8581
proxy_manager = get_proxy_manager()

overhave/transport/ldap/authenticator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _connect(self, login: str, password: SecretStr) -> None:
2222
ldap_connection.set_option(ldap.OPT_REFERRALS, 0)
2323
ldap_connection.set_option(ldap.OPT_NETWORK_TIMEOUT, self._settings.timeout.seconds)
2424
if self._settings.tls_enabled:
25-
ldap_connection.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_REQUIRE_CERT)
25+
ldap_connection.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_HARD)
2626
ldap_connection.start_tls_s()
2727
ldap_connection.simple_bind_s(f"{self._settings.domain}{login}", password.get_secret_value())
2828
self._ldap_connection = ldap_connection

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "overhave"
3-
version = "5.1.1"
3+
version = "5.1.2"
44
description = "Overhave - web-framework for BDD"
55
readme = "README.rst"
66
authors = [

0 commit comments

Comments
 (0)