Skip to content

Commit d42402c

Browse files
committed
Add default random ID
1 parent c8fcb76 commit d42402c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

view.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import dash_html_components as html
44
import plotly.express as px
55
import random
6+
import uuid
67

78

89
class AppView:
@@ -13,6 +14,7 @@ def __init__(self, name, db, config, server):
1314
self.app = dash.Dash(name, external_stylesheets=external_stylesheets, server=server)
1415
self.db = db
1516
self.current_idx = 0
17+
self.username = str(uuid.uuid4())
1618
self.appconfig = config
1719
self.subset = random.sample(range(len(config.options)), config.n2show)
1820
self.make_figure_image(self.current_idx)
@@ -82,7 +84,7 @@ def make_layout(self):
8284
dcc.Input(
8385
id="input_name",
8486
type='text',
85-
placeholder="Username",
87+
placeholder=self.username,
8688
),
8789
html.Button('Previous', id='previous'),
8890
html.Button('Next', id='next'),

0 commit comments

Comments
 (0)