mirror of
https://github.com/fastogt/fastocloud_admin.git
synced 2025-03-09 23:38:52 +00:00
Created date import
This commit is contained in:
parent
6d5fffa769
commit
5f7b3a9d8f
2 changed files with 12 additions and 8 deletions
|
@ -35,10 +35,11 @@ Activate service | {{ config['PUBLIC_CONFIG'].site.title }}
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="stream_number">#</th>
|
<th class="stream_number">#</th>
|
||||||
<th class="stream_name">{% trans %}Email{% endtrans %}</th>
|
<th class="login">{% trans %}Login{% endtrans %}</th>
|
||||||
<th class="provider_status">{% trans %}Create date{% endtrans %}</th>
|
<th class="create_date">{% trans %}Create date{% endtrans %}</th>
|
||||||
<th class="stream_name">{% trans %}Status{% endtrans %}</th>
|
<th class="end_date">{% trans %}Create date{% endtrans %}</th>
|
||||||
<th class="stream_actions">{% trans %}Actions{% endtrans %}</th>
|
<th class="status">{% trans %}Status{% endtrans %}</th>
|
||||||
|
<th class="actions">{% trans %}Actions{% endtrans %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
|
@ -45,7 +45,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
mycursor = mydb.cursor(dictionary=True)
|
mycursor = mydb.cursor(dictionary=True)
|
||||||
|
|
||||||
sql = 'SELECT username,password,exp_date,max_connections FROM users'
|
sql = 'SELECT username,password,created_at,exp_date,max_connections FROM users'
|
||||||
|
|
||||||
mycursor.execute(sql)
|
mycursor.execute(sql)
|
||||||
|
|
||||||
|
@ -55,9 +55,12 @@ if __name__ == '__main__':
|
||||||
new_user = SubscriberUser.make_subscriber(email=sql_entry['username'], password=sql_entry['password'],
|
new_user = SubscriberUser.make_subscriber(email=sql_entry['username'], password=sql_entry['password'],
|
||||||
country='US')
|
country='US')
|
||||||
new_user.status = SubscriberUser.Status.ACTIVE
|
new_user.status = SubscriberUser.Status.ACTIVE
|
||||||
sdate = sql_entry['exp_date']
|
created_at = sql_entry['created_at']
|
||||||
if sdate:
|
if created_at:
|
||||||
new_user.exp_date = datetime.fromtimestamp(sdate)
|
new_user.created_date = datetime.fromtimestamp(created_at)
|
||||||
|
exp_date = sql_entry['exp_date']
|
||||||
|
if exp_date:
|
||||||
|
new_user.exp_date = datetime.fromtimestamp(exp_date)
|
||||||
dev = Device(name='Xtream', max_connections=sql_entry['max_connections'])
|
dev = Device(name='Xtream', max_connections=sql_entry['max_connections'])
|
||||||
new_user.add_device(dev)
|
new_user.add_device(dev)
|
||||||
# save
|
# save
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue