Skip to content

Commit 82e28d5

Browse files
authored
Merge pull request #95 from x10102/master
v1.1.2 - Minor bugfixes
2 parents 3d01d4e + 7963814 commit 82e28d5

File tree

9 files changed

+10
-9
lines changed

9 files changed

+10
-9
lines changed

blueprints/articles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def notify_rolemaster(uid, point_amount):
3232
def delete_article(aid: int):
3333
article = Article.get_or_none(Article.id == aid) or abort(HTTPStatus.NOT_FOUND)
3434
article.delete_instance()
35-
info(f"Article {article.name} deleted by {current_user.nickname} (ID: {current_user.uid})")
35+
info(f"Article {article.name} deleted by {current_user.nickname} (ID: {current_user.get_id()})")
3636
flash(f'Článek {article.name} smazán')
3737
return "OK"
3838

blueprints/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def login():
3636
session['PRE_LOGIN_UID'] = user.id
3737
return redirect(url_for('UserAuth.pw_change'))
3838
login_user(user)
39-
referrer = session['login_next']
39+
referrer = session.get('login_next', None)
4040

4141
del session['login_next']
4242
return redirect(referrer or url_for('index'))

blueprints/autobackup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def backup_index():
200200
@login_required
201201
def backup_delete(backup_id: int):
202202
# TODO: 2FA
203-
info(f"Backup ID {backup_id} deleted by user {current_user.nickname} (ID: {current_user.id})")
203+
info(f"Backup ID {backup_id} deleted by user {current_user.nickname} (ID: {current_user.get_id()})")
204204
Backup.delete_by_id(backup_id)
205205
# TODO: Delete the actual archive
206206
# (Maybe schedule a task to purge deleted backups after some time to allow time for restore?)

blueprints/debug.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@DebugTools.before_request
1414
def log_debug_access():
1515
if not current_app.config['DEBUG'] and not current_user.is_anonymous:
16-
warning(f'Debug endpoint {request.full_path} accessed by {current_user.nickname} (ID: {current_user.id})')
16+
warning(f'Debug endpoint {request.full_path} accessed by {current_user.nickname} (ID: {current_user.get_id()})')
1717

1818
@DebugTools.route('/debug/nickupdate')
1919
@login_required
@@ -66,6 +66,7 @@ def raise_error():
6666
abort(HTTPStatus.INTERNAL_SERVER_ERROR)
6767

6868
@DebugTools.route('/debug/export_pubkey')
69+
@login_required
6970
def export_pubkey():
7071
info(f"Public key exported by user {current_user.nickname}")
7172
return send_from_directory(os.path.join(os.getcwd(), 'data', 'crypto'), 'scuttle.pub.asc', as_attachment=True)

blueprints/rsspage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def ignore_update():
2424
if not title:
2525
warning(f'Removing non-existent RSS Update with UUID {uuid}')
2626
else:
27-
info(f'RSS Update {uuid} ({title}) ignored by {current_user.nickname} (ID: {current_user.uid})')
27+
info(f'RSS Update {uuid} ({title}) ignored by {current_user.nickname} (ID: {current_user.get_id()})')
2828
return redirect(url_for('RssPageController.rss_changes'))
2929

3030
@RssPageController.route('/changes/forceupdate')

blueprints/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def delete_user(uid: int):
8787
user = User.get_or_none(User.id == uid) or abort(HTTPStatus.NOT_FOUND)
8888
name = user.nickname
8989
user.delete_instance()
90-
info(f"User {name} deleted by {current_user.nickname} (ID: {current_user.uid})")
90+
info(f"User {name} deleted by {current_user.nickname} (ID: {current_user.get_id()})")
9191
flash(f'Uživatel {name} smazán')
9292

9393
return redirect(url_for('index'))

constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APP_VERSION = "1.1.1"
1+
APP_VERSION = "1.1.2"
22
BRANCH_ID = "CS"

templates/embeds/writer/default.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<img class="block h-full bg-black border border-white border-solid rounded-l-lg" src="{{ url_for('UserContent.get_avatar', uid=(user.discord or 0), s='full')}}">
77
<div class="flex flex-col flex-1 h-full pl-4 text-white bg-black rounded-r-lg">
88
<h1 class="m-0 mt-1 text-xl font-bold text-white">{{user.wikidot}}</h1>
9-
<p class="m-0 text-sm"><b>{{stats.originals}}</b> Článků</p>
9+
<p class="m-0 text-sm"><b>{{stats.original_count}}</b> Článků</p>
1010
<p class="m-0 text-sm">Nejnovější článek: <b><a href="{{last.link}}" class="text-white transition-opacity hover:opacity-75" target="_top">{{last.name}}</b></a></p>
1111
</div>
1212
<div class="absolute top-0 right-0 block p-2 font-semibold text-white rounded-tr-lg rounded-bl-lg bg-gradient-to-r from-teal-200 to-teal-500">Spisovatel</div>

templates/embeds/writer/zozi.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<img class="block h-full bg-black border border-white border-solid rounded-l-lg" src="{{ url_for('UserContent.get_avatar', uid=(user.discord or 0), s='full')}}">
77
<div class="flex flex-col flex-1 h-full pl-4 bg-center text-white bg-pink-900 bg-[url('../../static/catto.png')] rounded-r-lg">
88
<h1 class="m-0 mt-1 text-xl font-bold text-white">{{user.wikidot}}</h1>
9-
<p class="m-0 text-sm"><b>{{stats.originals}}</b> Článků</p>
9+
<p class="m-0 text-sm"><b>{{stats.original_count}}</b> Článků</p>
1010
<p class="m-0 text-sm">Nejnovější článek: <b><a href="{{last.link}}" class="text-white transition-opacity hover:opacity-75" target="_top">{{last.name}}</b></a></p>
1111
</div>
1212
<div class="absolute top-0 right-0 block p-2 font-semibold text-white rounded-tr-lg rounded-bl-lg bg-gradient-to-r from-teal-200 to-teal-500">Spisovatel</div>

0 commit comments

Comments
 (0)