Fix issues based on linter

This commit is contained in:
rubenwardy
2023-06-18 22:21:37 +01:00
parent f2cfb6c17d
commit d808a5c822
19 changed files with 46 additions and 71 deletions

View File

@@ -14,9 +14,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import typing
from urllib.parse import urljoin, urlparse, urlunparse
import typing
import user_agents
from flask import request, abort
from flask_babel import LazyString

View File

@@ -47,7 +47,6 @@ def get_temp_dir():
def clone_repo(urlstr, ref=None, recursive=False):
gitDir = os.path.join(tempfile.gettempdir(), randomString(10))
err = None
try:
gitUrl = generate_git_url(urlstr)
print("Cloning from " + gitUrl)

View File

@@ -14,7 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import typing
from functools import wraps
from typing import List
@@ -87,7 +87,8 @@ def addNotification(target, causer: User, type: NotificationType, title: str, ur
db.session.add(notif)
def addAuditLog(severity: AuditSeverity, causer: User, title: str, url: str, package : Package =None, description : str =None):
def addAuditLog(severity: AuditSeverity, causer: User, title: str, url: typing.Optional[str],
package: Package = None, description: str = None):
entry = AuditLogEntry(causer, severity, title, url, package, description)
db.session.add(entry)