mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05:10 +01:00
Create User table, redirect to user's homepage on creation
This commit is contained in:
@@ -95,6 +95,7 @@ def index():
|
|||||||
|
|
||||||
|
|
||||||
@app.route('/<userkey>/')
|
@app.route('/<userkey>/')
|
||||||
|
@app.route('/<userkey>')
|
||||||
def bookmarks(userkey):
|
def bookmarks(userkey):
|
||||||
""" User homepage, list their (unfiltered) bookmarks """
|
""" User homepage, list their (unfiltered) bookmarks """
|
||||||
return object_list('bookmarks.html', Bookmark.select())
|
return object_list('bookmarks.html', Bookmark.select())
|
||||||
@@ -146,7 +147,7 @@ def adding(userkey):
|
|||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/<systemkey>/adduser/')
|
@app.route('/<systemkey>/adduser')
|
||||||
def adduser(systemkey):
|
def adduser(systemkey):
|
||||||
""" Add user endpoint, convenience """
|
""" Add user endpoint, convenience """
|
||||||
if systemkey == settings.SYSTEMKEY:
|
if systemkey == settings.SYSTEMKEY:
|
||||||
@@ -154,6 +155,7 @@ def adduser(systemkey):
|
|||||||
newuser.key = getkey()
|
newuser.key = getkey()
|
||||||
newuser.username = 'Nomen Nescio'
|
newuser.username = 'Nomen Nescio'
|
||||||
newuser.save()
|
newuser.save()
|
||||||
|
return redirect('/' + newuser.key, code=302)
|
||||||
else:
|
else:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
@@ -162,6 +164,7 @@ def adduser(systemkey):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# create the bookmark table if it does not exist
|
# create the bookmark table if it does not exist
|
||||||
Bookmark.create_table(True)
|
Bookmark.create_table(True)
|
||||||
|
User.create_table(True)
|
||||||
|
|
||||||
# run the application
|
# run the application
|
||||||
app.run(port=9999)
|
app.run(port=9999)
|
||||||
|
|||||||
Reference in New Issue
Block a user