turns out that didn't work
This commit is contained in:
parent
aeb1403a6c
commit
9c44286436
4 changed files with 3 additions and 10 deletions
|
@ -10,8 +10,6 @@ from sqlalchemy.orm import scoped_session,sessionmaker
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
from sqlalchemy.sql import text
|
from sqlalchemy.sql import text
|
||||||
|
|
||||||
import git
|
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('config.ini')
|
config.read('config.ini')
|
||||||
|
|
||||||
|
@ -28,9 +26,6 @@ db = scoped_session(sessionmaker(bind=engine))
|
||||||
|
|
||||||
Base = declarative_base()
|
Base = declarative_base()
|
||||||
|
|
||||||
repo = git.Repo(search_parent_directories=True)
|
|
||||||
sha = repo.head.object.hexsha
|
|
||||||
|
|
||||||
class User(Base):
|
class User(Base):
|
||||||
__tablename__ = 'users'
|
__tablename__ = 'users'
|
||||||
id = Column(Integer, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
|
@ -110,7 +105,7 @@ def register():
|
||||||
{"username": username, "password": password})
|
{"username": username, "password": password})
|
||||||
db.commit()
|
db.commit()
|
||||||
return redirect('/auth/login/') # redirect to login page after successful registration
|
return redirect('/auth/login/') # redirect to login page after successful registration
|
||||||
return render_template('register.j2', instanceLocation=instanceLocation, instanceBranding=instanceBranding, commit=str(sha))
|
return render_template('register.j2', instanceLocation=instanceLocation, instanceBranding=instanceBranding)
|
||||||
|
|
||||||
@app.route('/auth/logout/')
|
@app.route('/auth/logout/')
|
||||||
def logout():
|
def logout():
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
NyxAsk at {{ instanceBranding }}
|
NyxAsk at {{ instanceBranding }}
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
NyxAsk version {{ version }} (commit {{ commit }})
|
NyxAsk version {{ version }} (commit TODO)
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Source code: <a href="https://git.everypizza.im/n/nyxask/">https://git.everypizza.im/n/nyxask/</a>
|
Source code: <a href="https://git.everypizza.im/n/nyxask/">https://git.everypizza.im/n/nyxask/</a>
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
flask
|
flask
|
||||||
flask-sqlalchemy
|
flask-sqlalchemy
|
||||||
psycopg2
|
psycopg2
|
||||||
gitpython
|
|
|
@ -7,7 +7,6 @@ in pkgs.mkShell {
|
||||||
flask
|
flask
|
||||||
flask-sqlalchemy
|
flask-sqlalchemy
|
||||||
psycopg2
|
psycopg2
|
||||||
gitpython
|
|
||||||
]))
|
]))
|
||||||
];
|
];
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue