Changed the css font and the token length to 6
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ from tiny0 import db
|
||||
|
||||
class URL(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
token = db.Column(db.String(8), index=True, unique=True, nullable=False)
|
||||
token = db.Column(db.String(6), index=True, unique=True, nullable=False)
|
||||
url = db.Column(db.String(2000), nullable=False)
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: sans-serif;
|
||||
font-family: 'Roboto Mono', monospace;
|
||||
}
|
||||
|
||||
body {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ token_characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwx
|
||||
def gen_valid_token():
|
||||
while True:
|
||||
# Generate a token
|
||||
token = "".join(choice(token_characters) for i in range(8))
|
||||
token = "".join(choice(token_characters) for i in range(6))
|
||||
|
||||
# If the token does not exists in the database
|
||||
if not URL.query.filter_by(token=token).first():
|
||||
|
||||
Reference in New Issue
Block a user