diff --git a/files/helpers/blackjack.py b/files/helpers/blackjack.py index 6b08d90d5..d560aad86 100644 --- a/files/helpers/blackjack.py +++ b/files/helpers/blackjack.py @@ -93,10 +93,14 @@ def player_hit(from_comment, did_double_down=False): if player_value == -1: status = 'bust' apply_game_result(from_comment, wager, status, kind) + elif len(player_hand) >= 5: + status = 'won' + apply_game_result(from_comment, wager, status, kind) from_comment.blackjack_result = format_all(player_hand, dealer_hand, deck, status, wager, kind, int(is_insured)) - if (did_double_down or player_value == 21): player_stayed(from_comment) + if (did_double_down or player_value == 21) and status == 'active': + player_stayed(from_comment) def player_stayed(from_comment): player_hand, dealer_hand, deck, status, wager, kind, is_insured = from_comment.blackjack_result.split("_") diff --git a/files/helpers/const.py b/files/helpers/const.py index 202f72989..9ce6daf06 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -824,7 +824,7 @@ emoji_regex3 = re.compile(f"(?([\w:~,()\-.#&\/=?@%;+]{5,250})<\/a>', flags=re.A) -email_regex = re.compile('[^@]+@[^@]+\.[^@]+', flags=re.A) +email_regex = re.compile('[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}', flags=re.A|re.I) utm_regex = re.compile('utm_[a-z]+=[a-z0-9_]+&', flags=re.A) utm_regex2 = re.compile('[?&]utm_[a-z]+=[a-z0-9_]+', flags=re.A) diff --git a/files/templates/comments.html b/files/templates/comments.html index 29fd6a770..15277be35 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -845,7 +845,7 @@ {% endif %} {% if v %} - + {% endif %} diff --git a/files/templates/submit.html b/files/templates/submit.html index c3954b2cd..c06b458a8 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -224,7 +224,7 @@ {% endif %} - + {% include "emoji_modal.html" %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index cb39d5339..66060637e 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -769,7 +769,7 @@ {% endif %} - + {% if v and v.id != u.id and '/comments' not in request.path %} diff --git a/schema.sql b/schema.sql index b6cfe89eb..bf01d0004 100644 --- a/schema.sql +++ b/schema.sql @@ -2,7 +2,7 @@ -- PostgreSQL database dump -- --- Dumped from database version 13.6 +-- Dumped from database version 13.7 -- Dumped by pg_dump version 14.2 (Ubuntu 14.2-1.pgdg20.04+1) SET statement_timeout = 0;