internal 1.1.41__py3-none-any.whl → 1.1.42__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of internal might be problematic. Click here for more details.

internal/utils.py CHANGED
@@ -6,7 +6,7 @@ from datetime import datetime, timezone
6
6
  import arrow
7
7
 
8
8
  from .base_config import BaseConfig
9
- from .const import STR_EMPTY, ARR_EXPORT_DATETIME_FMT, STR_DASH, REDIS_LPR_DATA_LIST_PREFIX
9
+ from .const import STR_EMPTY, ARR_EXPORT_DATETIME_FMT, STR_DASH, REDIS_LPR_DATA_LIST_PREFIX, STR_SPACE
10
10
 
11
11
 
12
12
  def is_today(time, system_time_zone):
@@ -49,7 +49,7 @@ def update_dict_with_cast(curr_settings: BaseConfig, new_conf: dict):
49
49
 
50
50
 
51
51
  def sanitize_plate_no(plate_no):
52
- return plate_no.replace(STR_DASH, STR_EMPTY).upper()
52
+ return plate_no.replace(STR_SPACE, STR_EMPTY).replace(STR_DASH, STR_EMPTY).upper()
53
53
 
54
54
 
55
55
  def get_current_utc() -> datetime:
@@ -10,8 +10,12 @@ def verify_and_sanitize_plate_no(value: str, is_require: bool = False):
10
10
  raise PlateNoFormatException()
11
11
 
12
12
  if value:
13
- if not re.match(r'^[A-Za-z0-9]{6,7}$', value):
13
+ # 移除空格和常見分隔符號進行檢查
14
+ cleaned = sanitize_plate_no(value)
15
+
16
+ if not re.match(r'^[外使領試臨國A-Za-z0-9]{5,7}$', cleaned):
14
17
  raise PlateNoFormatException()
18
+
15
19
  return sanitize_plate_no(value)
16
20
 
17
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.1.41
3
+ Version: 1.1.42
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -33,8 +33,8 @@ internal/middleware/log_request.py,sha256=ZtCyfrF3IyKTF6Uj8L66CutdZi3srVmppqO_EX
33
33
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  internal/model/base_model.py,sha256=-YlVPZGuG926PksyQw5SgKjkdC80q_eQTL3EnzVSfIs,8020
35
35
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
36
- internal/utils.py,sha256=dVhKi3WPXQzVjaIGZBdfNjkMYtE7O-vKeyyOSX4mTG0,4518
37
- internal/validator_utils.py,sha256=CqjaVFoAu5MqvBG_AkTP-r7AliWawtUWB851USj4moI,1519
38
- internal-1.1.41.dist-info/METADATA,sha256=Z2yv-pszFA4IbgjeWkBwpuNyMHyDtv3XYV-w2DgnM3U,939
39
- internal-1.1.41.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
40
- internal-1.1.41.dist-info/RECORD,,
36
+ internal/utils.py,sha256=6iIM1EPLeYYj5LEdgqDADGH-52q9YM6lOxaaxs6z1Gg,4559
37
+ internal/validator_utils.py,sha256=0Wkf3fjpIQx1lrYmDJM-olamEb6q6CI15NN_XpsLHgQ,1640
38
+ internal-1.1.42.dist-info/METADATA,sha256=wrl81JhcSdmzm0cH7WNxu9sd-mToyhK2dmUYvgsYnKs,939
39
+ internal-1.1.42.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
40
+ internal-1.1.42.dist-info/RECORD,,