From 404fdb000f4ed26322095b156b04c79121dd24be Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Jul 2022 13:39:56 +0100 Subject: [PATCH] Don't attempt to register if it is disabled --- .pre-commit-config.yaml | 13 +++++++++++++ modules/regproc.py | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..98fa1cb --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: +- repo: https://github.com/ambv/black + rev: 22.3.0 + hooks: + - id: black + args: + - --line-length=120 +- repo: https://gitlab.com/pycqa/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + args: + - "--max-line-length=120" diff --git a/modules/regproc.py b/modules/regproc.py index 5cf52f6..ce0e5a2 100644 --- a/modules/regproc.py +++ b/modules/regproc.py @@ -6,6 +6,11 @@ from copy import deepcopy from random import choice def needToRegister(net): + # Check if the network does not support authentication + networkObj = main.network[net] + if networkObj.auth == "none": + return False + # Check if the IRC network definition has registration disabled inst = selectInst(net) if "register" in inst.keys(): if inst["register"]: