Fix user cleaning & add loading ref_link

This commit is contained in:
Reckless_Satoshi 2022-03-06 11:12:47 -08:00
parent aa89fa603e
commit 5726b82634
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
4 changed files with 15 additions and 17 deletions

View File

@ -20,14 +20,18 @@ def users_cleansing():
# And do not have an active trade, any past contract or any reward.
deleted_users = []
for user in queryset:
if user.profile.pending_rewards > 0 or user.profile.earned_rewards > 0 or user.profile.claimed_rewards > 0:
continue
if not user.profile.total_contracts == 0:
continue
valid, _, _ = Logics.validate_already_maker_or_taker(user)
if valid:
deleted_users.append(str(user))
user.delete()
# Try an except, due to unknown cause for users lacking profiles.
try:
if user.profile.pending_rewards > 0 or user.profile.earned_rewards > 0 or user.profile.claimed_rewards > 0:
continue
if not user.profile.total_contracts == 0:
continue
valid, _, _ = Logics.validate_already_maker_or_taker(user)
if valid:
deleted_users.append(str(user))
user.delete()
except:
pass
results = {
"num_deleted": len(deleted_users),
@ -63,13 +67,11 @@ def follow_send_payment(lnpayment):
"""Sends sats to buyer, continuous update"""
from decouple import config
from base64 import b64decode
from django.utils import timezone
from datetime import timedelta
from api.lightning.node import LNNode, MACAROON
from api.models import LNPayment, Order
from api.logics import Logics
fee_limit_sat = int(
max(

View File

@ -74,7 +74,7 @@ export default class BottomBar extends Component {
profileShown: false,
alternative_site: 'robosats...',
node_id: '00000000',
referral_link: 'No referral link',
referral_link: 'Loading...',
earned_rewards: 0,
rewardInvoice: null,
badInvoice: false,
@ -84,10 +84,6 @@ export default class BottomBar extends Component {
this.getInfo();
}
handleClickSuppport = () => {
window.open("https://t.me/robosats");
};
getInfo() {
this.setState(null)
fetch('/api/info/')
@ -381,7 +377,7 @@ export default class BottomBar extends Component {
</ListItemText>
:
<form style={{maxWidth: 270}}>
<Grid containter alignItems="stretch" style={{ display: "flex"}} align="center">
<Grid alignItems="stretch" style={{ display: "flex"}} align="center">
<Grid item alignItems="stretch" style={{ display: "flex" }} align="center">
<TextField
error={this.state.badInvoice}

File diff suppressed because one or more lines are too long