Commit 806e0d66 authored by wanliofficial's avatar wanliofficial

update

parent f33137fd
...@@ -25,10 +25,7 @@ config = dict( ...@@ -25,10 +25,7 @@ config = dict(
}, },
TABLE_PREFIX='evm_store_', TABLE_PREFIX='evm_store_',
MD5_SALT="EhuqUkwV", MD5_SALT="EhuqUkwV",
<<<<<<< Updated upstream
=======
UPLOAD_SERVER="{}://{}:{}/".format(conf.get('uploads', 'protocol'), conf.get('uploads', 'host'), conf.get('uploads', 'port')), UPLOAD_SERVER="{}://{}:{}/".format(conf.get('uploads', 'protocol'), conf.get('uploads', 'host'), conf.get('uploads', 'port')),
>>>>>>> Stashed changes
UPLOAD_PATH=os.getcwd(), UPLOAD_PATH=os.getcwd(),
UPLOAD_DIR=conf.get('uploads', 'upload_dir'), UPLOAD_DIR=conf.get('uploads', 'upload_dir'),
TEMPLATE_PATH=os.path.join(os.getcwd(), "static"), TEMPLATE_PATH=os.path.join(os.getcwd(), "static"),
......
...@@ -34,18 +34,14 @@ class AppsManager(object): ...@@ -34,18 +34,14 @@ class AppsManager(object):
def add(self, user, data): def add(self, user, data):
with db_session: with db_session:
<<<<<<< Updated upstream
editor = User.get(id=user) editor = User.get(id=user)
======= if not editor:
return False, "current user is not exists"
result = Apps.get(app_name=data.get("app_name"), is_delete=False) result = Apps.get(app_name=data.get("app_name"), is_delete=False)
if result: if result:
return False, "app_name has been exists." return False, "app_name has been exists."
editor = User.get(id=request.current_user.get("id"))
>>>>>>> Stashed changes
if not editor:
return False, "current user is not exists"
data.update({ data.update({
'create_by': editor, 'create_by': editor,
'create_at': datetime.now(), 'create_at': datetime.now(),
......
...@@ -149,8 +149,8 @@ class DownloadManager(object): ...@@ -149,8 +149,8 @@ class DownloadManager(object):
down = AppDownload(app=app[0], imei=data.get("imei")) down = AppDownload(app=app[0], imei=data.get("imei"))
commit() commit()
if down: if down:
ip = flask_request.remote_addr real_ip = flask_request.headers['X-Forwarded-For']
update_download_information(ip, down.id) update_download_information(real_ip, down.id)
return epk_path, "get dictionary {}.".format("success" if epk_path else "no data") return epk_path, "get dictionary {}.".format("success" if epk_path else "no data")
......
Markdown is supported
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