From 68045cc60c7160b11cb4fbbe655be750de4d0851 Mon Sep 17 00:00:00 2001 From: corubba Date: Sat, 7 May 2022 21:14:29 +0200 Subject: [PATCH 1/4] Fix revision in migration filename This has no functional impact, flask-migrate aka alembic was and will continue to work as expected. It is just a cosmetic change for consistency. --- ...in_the_db.py => 31a4ed468b18_remove_all_settings_in_the_db.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename migrations/versions/{1274ed462010_remove_all_settings_in_the_db.py => 31a4ed468b18_remove_all_settings_in_the_db.py} (100%) diff --git a/migrations/versions/1274ed462010_remove_all_settings_in_the_db.py b/migrations/versions/31a4ed468b18_remove_all_settings_in_the_db.py similarity index 100% rename from migrations/versions/1274ed462010_remove_all_settings_in_the_db.py rename to migrations/versions/31a4ed468b18_remove_all_settings_in_the_db.py From 0e2cd063c5a522c103df1aa401f077ea4523faba Mon Sep 17 00:00:00 2001 From: corubba Date: Sat, 7 May 2022 21:14:48 +0200 Subject: [PATCH 2/4] Remove python v2 remnant As vermin [0] confirms, the codebase has long moved beyond supporting python v2 (which is not a bad thing). This removes the last explicit py2 piece of code. And in case anyone wonders, vermin currently reports the minium version to be v3.6. [0] https://pypi.org/project/vermin/ --- powerdnsadmin/models/user.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index 1802492..1b34d62 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -83,10 +83,7 @@ class User(db.Model): return False def get_id(self): - try: - return unicode(self.id) # python 2 - except NameError: - return str(self.id) # python 3 + return str(self.id) def __repr__(self): return ''.format(self.username) From fec649b7476d0a7cdeb3a011620003acef1d250a Mon Sep 17 00:00:00 2001 From: corubba Date: Sat, 7 May 2022 21:14:57 +0200 Subject: [PATCH 3/4] Header for fixed order column Semantically and syntactically it is better to have the same number of `` as ``. Not that anyone will ever see that new header, since that column is always invisible (except if the user disables javascript). Plus remove a unmatched closing html element. --- powerdnsadmin/templates/domain.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/templates/domain.html b/powerdnsadmin/templates/domain.html index e5863cd..d5e85fc 100755 --- a/powerdnsadmin/templates/domain.html +++ b/powerdnsadmin/templates/domain.html @@ -60,6 +60,7 @@ {% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %} Changelog {% endif %} + Invisible Sorting Column @@ -104,7 +105,6 @@ {% endif %} - {% if current_user.role.name in ['Administrator', 'Operator'] or SETTING.get('allow_user_view_history') %}