1
0
Fork 0
mirror of https://github.com/fastogt/fastocloud_admin.git synced 2025-03-09 23:38:52 +00:00

Import resellers

This commit is contained in:
topilski 2019-09-22 03:06:31 -04:00
parent a69a2960af
commit 10bb740ad8
5 changed files with 67 additions and 6 deletions

View file

@ -0,0 +1,17 @@
from app.home.entry import ProviderUser
from app.service.service import ServiceSettings
def import_resellers_to_server(db, server: ServiceSettings):
cursor = db.cursor(dictionary=True)
sql = 'SELECT username,password from reg_users'
cursor.execute(sql)
sql_providers = cursor.fetchall()
for sql_entry in sql_providers:
new_user = ProviderUser.make_provider(email=sql_entry['username'], password=sql_entry['username'], country='US')
new_user.status = ProviderUser.Status.ACTIVE
new_user.add_server(server)
server.add_provider(new_user)
cursor.close()

View file

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import json
from app.common.stream.entry import ProxyStream
@ -6,8 +5,6 @@ from app.service.service import ServiceSettings
from app.common.utils.utils import is_valid_http_url
import app.common.constants as constants
PROJECT_NAME = 'import_streams_from_xtream'
def import_streams_to_server(db, server: ServiceSettings):
cursor = db.cursor(dictionary=True)

View file

@ -1,12 +1,9 @@
#!/usr/bin/env python3
from datetime import datetime
from app.common.subscriber.login.entry import SubscriberUser
from app.common.subscriber.entry import Device
from app.service.service import ServiceSettings
PROJECT_NAME = 'import_subscribers_from_xtream'
def import_subscribers_to_server(db, server: ServiceSettings):
cursor = db.cursor(dictionary=True)