up
This commit is contained in:
parent
6f4360adb2
commit
ad1aca5838
6 changed files with 23 additions and 11 deletions
|
@ -97,7 +97,7 @@ class UsersDetails(PgSQLModel):
|
||||||
city = CharField(null=True, default='')
|
city = CharField(null=True, default='')
|
||||||
country = CharField(null=True, default='')
|
country = CharField(null=True, default='')
|
||||||
state = CharField(null=True, default='')
|
state = CharField(null=True, default='')
|
||||||
zipcode = IntegerField(null=True, default='')
|
zipcode = IntegerField(null=True, default=0)
|
||||||
|
|
||||||
|
|
||||||
class UsersBalance(PgSQLModel):
|
class UsersBalance(PgSQLModel):
|
||||||
|
|
|
@ -1,14 +1,19 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
|
import sys
|
||||||
import os
|
import os
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
|
||||||
__author__ = 'sa'
|
default_file = '/etc/sws/cloud/settings.ini'
|
||||||
|
# default_file = '%s/gocloud.ini' % os.getenv('HOME')
|
||||||
|
|
||||||
|
settings_file = os.getenv('CLOUDNS_SETTINGS_FILE', default_file)
|
||||||
|
|
||||||
|
# current_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
current_path = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
# setting file read
|
# setting file read
|
||||||
settings = ConfigParser.ConfigParser()
|
settings = ConfigParser.ConfigParser()
|
||||||
if os.path.exists(current_path + "/../settings.ini"):
|
if os.path.exists(settings_file):
|
||||||
settings.read(current_path + "/../settings.ini")
|
settings.read(settings_file)
|
||||||
else:
|
else:
|
||||||
print "Fail"
|
sys.exit('settings file not found: %s' % settings_file)
|
||||||
|
|
|
@ -191,7 +191,7 @@ def login():
|
||||||
password = request.form['password']
|
password = request.form['password']
|
||||||
|
|
||||||
# validation entered data
|
# validation entered data
|
||||||
if not requests.email(email):
|
if not validators.email(email):
|
||||||
flash(u'Неправильный адрес електронной почты', 'error')
|
flash(u'Неправильный адрес електронной почты', 'error')
|
||||||
return redirect(url_for('account.login'))
|
return redirect(url_for('account.login'))
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
import validators
|
import validators
|
||||||
|
|
||||||
from flask import Blueprint
|
from flask import Blueprint, flash
|
||||||
from flask import g
|
from flask import g
|
||||||
from flask import jsonify
|
from flask import jsonify
|
||||||
from flask import redirect
|
from flask import redirect
|
||||||
|
@ -51,8 +51,8 @@ def login():
|
||||||
# redirect to rules list
|
# redirect to rules list
|
||||||
return redirect(url_for('administrator.dashboard'))
|
return redirect(url_for('administrator.dashboard'))
|
||||||
else:
|
else:
|
||||||
flah('Invalid login. Please try again.')
|
flash('Invalid login. Please try again.')
|
||||||
return redirect('administrator.login')
|
return redirect(url_for('administrator.login'))
|
||||||
return render_template('administrator/login.html')
|
return render_template('administrator/login.html')
|
||||||
|
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -4,7 +4,7 @@ from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='SWSCloudCore',
|
name='SWSCloudCore',
|
||||||
version='2.1.2',
|
version='2.1.6',
|
||||||
author='Vyacheslav Anzhiganov',
|
author='Vyacheslav Anzhiganov',
|
||||||
author_email='hello@anzhiganov.com',
|
author_email='hello@anzhiganov.com',
|
||||||
packages=[
|
packages=[
|
||||||
|
|
7
swscloud-runserver.py
Normal file
7
swscloud-runserver.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
from SWSCloudCore import app
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run()
|
Loading…
Add table
Reference in a new issue