Commit 8cddd645 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

Move to python3. initial

parent 6524a628
......@@ -8,6 +8,7 @@
# Third-party modules
from __future__ import absolute_import
from builtins import object
from peewee import (Model, CharField, TextField, ForeignKeyField,
DateTimeField, BooleanField)
......@@ -17,7 +18,7 @@ from .environment import Environment
class PullLog(Model):
class Meta:
class Meta(object):
database = db
db_table = "pulllog"
......
......@@ -8,6 +8,8 @@
# Third-party modules
from __future__ import absolute_import
from builtins import str
from builtins import object
from peewee import CharField, TextField, ForeignKeyField, BooleanField
from playhouse.signals import Model, post_save
import os
......@@ -58,7 +60,7 @@ DEFAULT_ROLES = [
class Role(Model):
class Meta:
class Meta(object):
database = db
db_table = "role"
indexes = (
......
......@@ -6,6 +6,7 @@
# See LICENSE for details
# ----------------------------------------------------------------------
from __future__ import absolute_import
from builtins import object
import os
import yaml
......@@ -21,7 +22,7 @@ from .pool import Pool
class Service(Model):
class Meta:
class Meta(object):
database = db
db_table = "service"
indexes = (
......
......@@ -8,6 +8,7 @@
# Python modules
from __future__ import absolute_import
from builtins import object
import base64
import json
import os
......@@ -20,7 +21,7 @@ from .db import db
class Settings(Model):
class Meta:
class Meta(object):
database = db
db_table = "settings"
......
......@@ -7,6 +7,7 @@
# ----------------------------------------------------------------------
from __future__ import absolute_import
from builtins import object
import bcrypt
# Third-party modules
from peewee import Model, CharField, BooleanField, DoesNotExist
......@@ -16,7 +17,7 @@ from .db import db
class User(Model):
class Meta:
class Meta(object):
database = db
db_table = "user"
......@@ -32,7 +33,7 @@ class User(Model):
:param password:
:return:
"""
if isinstance(password, unicode):
if isinstance(password, str):
password = password.encode("utf-8")
return bcrypt.hashpw(password, bcrypt.gensalt(10))
......@@ -44,9 +45,9 @@ class User(Model):
:param hashed:
:return:
"""
if isinstance(password, unicode):
if isinstance(password, str):
password = password.encode("utf-8")
if isinstance(hashed, unicode):
if isinstance(hashed, str):
hashed = hashed.encode("utf-8")
return bcrypt.hashpw(password, hashed) == hashed
......
......@@ -5,7 +5,7 @@
<title>NOC Tower: {{ installation_name }}</title>
<!-- Load used libraries -->
<link rel="stylesheet" href="{{ hashed("/ui/pkg/webix/webix.css") }}" type="text/css">
<link rel="icon" type="image/png" href="{{ hashed("/ui/pkg/favicon/airport.png") }}">
<link rel="icon" type="image/png" href="/ui/pkg/favicon/airport.png">
<script src="{{ hashed("/ui/pkg/webix/webix.js") }}" type="text/javascript"></script>
<!-- Load selected skin -->
<script src="{{ hashed("/ui/skin.js") }}" type="text/javascript"></script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment