luukas
0eac0721ea
Remove unused DatabaseShortcuts imports
2022-05-25 16:17:01 +03:00
luukas
4e84eee5a5
Rename server stats variables to server_stats
2022-05-25 16:15:51 +03:00
luukas
83018c6860
Calculate the min stats date with timedelta
...
This is more correct than just using days.
I've also tested this working in a completely separate Peewee project.
2022-05-25 16:14:42 +03:00
luukas
a937a94ac8
Use a better variable name for stat disappear date
...
* Rename occurences of `last_week` with `minimum_to_exist`
2022-05-25 14:49:17 +03:00
luukas
4b707aa9d1
Don't use get_latest_server_stats
...
Use get_server_stats_by_id instead of get_latest_server_stats
The reasoning behind this is that all usages of get_latest_server_stats
had `DatabaseShortcuts.return_rows(latest)[0]`, which
get_server_stats_by_id already did
2022-05-25 14:43:05 +03:00
luukas
166272e12c
Replace .count() != 0
with .exists()
2022-05-25 14:24:34 +03:00
Andrew
7ca7232829
Add question to warning message
2022-05-24 19:11:14 -04:00
Iain Powrie
54c81d6dd4
Merge branch 'bugfix/api-v2-bugfixes' into 'dev'
...
API v2 bug fixes
See merge request crafty-controller/crafty-4!267
2022-05-24 22:42:41 +00:00
luukas
2ac9118152
Merge remote's bugfix/api-v2-bugfixes to local
2022-05-25 00:58:32 +03:00
luukas
cbc73b7e92
Fix routing for the user permissions handler
2022-05-25 00:58:10 +03:00
luukas
57ef5e27dd
Add route for viewing user Crafty permissions
...
The route includes the permission mask, counters and limits
2022-05-25 00:55:49 +03:00
luukas
6dadce2c9a
Enable changing more of yourself with superuser
...
Enable modifying your own superuser status, permissions and roles if you
have superuser status
2022-05-25 00:43:49 +03:00
luukas
b0d342e949
Check if something is in a dict with a simpler way
...
* Replace `data.get("key", None) is not None` with `"key" in data`
2022-05-25 00:39:16 +03:00
luukas
2aa2d14f5e
Improve the invalidate tokens API handler
...
* Remove the TODO
* Replace the Console.info with logger.debug
2022-05-25 00:35:11 +03:00
luukas
9a9d101015
Add pasword hashing to API user modification
2022-05-25 00:32:31 +03:00
luukas
54ff888002
Fix user modification via the API
2022-05-25 00:29:31 +03:00
Iain Powrie
db13b11f18
Merge branch 'tweak/pretzel-wss-error' into 'dev'
...
Add link to documentation to WSS error
See merge request crafty-controller/crafty-4!272
2022-05-24 18:14:06 +00:00
Zedifus
f69cf39c1d
Add Hebrew lang file
...
Up to date to 3.5, altered credits trans keys amended,
Patreon will need amended to Patreon / Ko-fi like en lang,
this will be done on final beta translation update.
Thanks thefourcraft
2022-05-24 18:58:37 +01:00
Andrew
5104c34513
Add link to documentation to WSS error
2022-05-23 21:23:29 -04:00
Zedifus
d0596af4c9
Add exemption orjson no-member falsepositive
2022-05-23 22:54:06 +01:00
Zedifus
2a4295d9b3
Add subscription source parsing & format html
2022-05-23 22:21:32 +01:00
Zedifus
11335b58f3
Update Translations for kofi credit support
...
More sane key naming as multiple sources, title & desc update too.
2022-05-23 22:20:19 +01:00
luukas
afdffcd836
Optimize get_user_permissions_mask
2022-05-23 23:03:50 +03:00
luukas
4c981f50c2
Add more permission validation in user creation
2022-05-23 22:45:27 +03:00
luukas
0d62223982
Merge branch 'dev' into bugfix/api-v2-bugfixes
2022-05-23 20:20:49 +03:00
Iain Powrie
da483b9291
Merge branch 'bug/pretzel-database-exit' into 'dev'
...
Fix error where database atomic is not needed
See merge request crafty-controller/crafty-4!269
2022-05-23 10:05:46 +00:00
Iain Powrie
f01f04ef97
Merge branch 'merge/cleanup-nosquash' into 'dev'
...
New merge request for cleanup
See merge request crafty-controller/crafty-4!268
2022-05-23 10:01:40 +00:00
Andrew
f099639cc6
Fix error where database atomic is not needed
2022-05-21 14:26:58 -04:00
luukas
8f8b2aa22f
Simplify MainPrompt.emptyline.
2022-05-21 02:04:03 +03:00
luukas
b49bca3279
Use a tab character in the threads prompt command
...
https://i.imgur.com/jy0Rlgm.png
2022-05-21 01:57:40 +03:00
luukas
b724fc500d
Improve the startup process
2022-05-21 01:53:17 +03:00
luukas
eff7aefb6e
Use local date and time formatting for Console
2022-05-21 01:41:48 +03:00
luukas
d97bcc608f
Fix info message in tornado server starter
...
Yes I know it's a 1 character replace
2022-05-21 00:00:21 +03:00
luukas
f82241f728
Fix circular import and linting for stats.py
2022-05-20 23:33:42 +03:00
luukas
ed9d994083
Fix linting in models/crafty_permissions.py
2022-05-20 23:23:18 +03:00
luukas
c1ebb16dff
Add typings to minecraft/stats.py
2022-05-20 22:05:37 +03:00
luukas
02f5318f76
Merge branch 'dev' into merge/pretzel-lukas-cleanup-nosquash
2022-05-20 22:04:41 +03:00
luukas
9ddcd13f2f
Fix W0611 & R1734 lint issues
2022-05-20 14:06:46 +03:00
luukas
dba3fafa87
Use shorthand for Controller.check_system_user
...
This reduced the code from 4 lines to 1 line.
The code
if <condition>:
return True
else:
return False
can be shortened to
return <condition>
2022-05-20 13:31:30 +03:00
luukas
1b059b24df
Update get_*_column functions
...
Use getattr instead of model_to_dict in single columns. We might want to
change the functions later on so peewee's ForeignKeyField primary key
shorthand like model.server_id instead of model.server.server_id
will work.
This will very likely increase performance of the get_*_column functions
due to not having to call the model_to_dict function from Peewee's
helper library.
2022-05-20 13:15:50 +03:00
luukas
48948423c9
Fix various things in create_api_server
2022-05-20 01:33:02 +03:00
Iain Powrie
379f680312
Merge branch 'bug/pretzel-stats-db-name' into 'dev'
...
Change naming of servers stats to generic name
See merge request crafty-controller/crafty-4!264
2022-05-19 21:13:07 +00:00
amcmanu3
ca170b86e0
Change naming of servers stats to generic name
2022-05-19 12:14:30 -04:00
luukas
7a7c7501e6
Use relative path for latest.log
2022-05-19 17:27:36 +03:00
luukas
73175d0f82
Remove the root example from the new server schema
...
* It messed up https://json-schema-faker.js.org
* It wasn't updated for agree_to_eula
2022-05-19 16:32:18 +03:00
luukas
bd4a35b418
Make role add and edit use API v2 internal APIs
2022-05-19 16:13:25 +03:00
luukas
f763fa9d0c
Fix API v2 server modification
2022-05-19 16:01:03 +03:00
Iain Powrie
1e96e7a6c9
Merge branch 'merge/api-v2' into 'dev'
...
New API v2 PR
See merge request crafty-controller/crafty-4!254
2022-05-18 23:27:19 +00:00
amcmanu3
67e20302c9
Add get_perms_server back
2022-05-18 19:19:58 -04:00
Iain Powrie
11b7817a11
Merge branch 'dev-BetterDisplayMobile' into 'dev'
...
Better display on mobile
See merge request crafty-controller/crafty-4!229
2022-05-18 23:13:05 +00:00