Compare commits
2 Commits
517b6300a2
...
0ef938ed5c
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ef938ed5c | |||
| b92d9f7a3e |
@ -41,7 +41,7 @@ from data.showcase_link import ShowCaseLink
|
||||
from data import db_session
|
||||
|
||||
app = Flask(__name__)
|
||||
with open('../incepted.config', 'r', encoding='utf-8') as file:
|
||||
with open('incepted.config', 'r', encoding='utf-8') as file:
|
||||
file = file.read()
|
||||
file = loads(file)
|
||||
key = file["encrypt_key"]
|
||||
@ -114,10 +114,10 @@ def admin():
|
||||
egg_form = EggForm()
|
||||
if request.method == 'POST':
|
||||
if egg_form.egg.data:
|
||||
with open('../egg.txt', 'w', encoding='utf-8') as file_egg:
|
||||
with open('egg.txt', 'w', encoding='utf-8') as file_egg:
|
||||
file_egg.write('1')
|
||||
else:
|
||||
with open('../egg.txt', 'w', encoding='utf-8') as file_egg:
|
||||
with open('egg.txt', 'w', encoding='utf-8') as file_egg:
|
||||
file_egg.write('2')
|
||||
data_form = request.form.to_dict()
|
||||
del data_form['csrf_token'], data_form['submit']
|
||||
@ -136,7 +136,7 @@ def admin():
|
||||
user.banned = 0
|
||||
user.activated = 1
|
||||
data_session.commit()
|
||||
with open('../egg.txt', 'r', encoding='utf-8') as file_egg:
|
||||
with open('egg.txt', 'r', encoding='utf-8') as file_egg:
|
||||
egg_form.egg.data = True if int(file_egg.read()) == 1 else False
|
||||
return render_template('admin.html', title='Панель админа', roles=roles, users=users,
|
||||
form=form, egg_form=egg_form)
|
||||
@ -782,7 +782,7 @@ def logout():
|
||||
@app.route('/register', methods=['GET', 'POST'])
|
||||
def register():
|
||||
if not current_user.is_authenticated:
|
||||
with open('../egg.txt', 'r', encoding='utf-8') as file_egg:
|
||||
with open('egg.txt', 'r', encoding='utf-8') as file_egg:
|
||||
egg = int(file_egg.read())
|
||||
form = RegisterForm()
|
||||
if form.validate_on_submit():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user