mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 15:57:02 +01:00 
			
		
		
		
	Do not add random entries into the transactions because the user is given invalid negative tokens
This commit is contained in:
		@@ -22,8 +22,6 @@ def set_titan_token(user_id, amt_change, action):
 | 
				
			|||||||
    else:
 | 
					    else:
 | 
				
			||||||
        token_count = 0
 | 
					        token_count = 0
 | 
				
			||||||
        token_usr = TitanTokens(user_id, 0)
 | 
					        token_usr = TitanTokens(user_id, 0)
 | 
				
			||||||
        db.session.add(token_usr)
 | 
					 | 
				
			||||||
        db.session.commit()
 | 
					 | 
				
			||||||
    new_token_count = token_count + amt_change
 | 
					    new_token_count = token_count + amt_change
 | 
				
			||||||
    if new_token_count < 0:
 | 
					    if new_token_count < 0:
 | 
				
			||||||
        return False
 | 
					        return False
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user