Skip to content

Commit ba22ded

Browse files
committed
add missing utils/data to kw docs
1 parent 6a5bada commit ba22ded

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

docs/localflavor/kw.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,17 @@ Forms
66

77
.. automodule:: localflavor.kw.forms
88
:members:
9+
10+
Utilities
11+
---------
12+
13+
.. automodule:: localflavor.kw.utils
14+
:members:
15+
16+
Data
17+
____
18+
19+
20+
.. autodata:: localflavor.kw.kw_areas.AREA_CHOICES
21+
22+
.. autodata:: localflavor.kw.kw_governorates.GOVERNORATE_CHOICES

localflavor/kw/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
def is_valid_civil_id(cid):
55
"""
6-
Checks the validity of a Kuwaiti Civil ID number
7-
by verifying the following:
8-
* The number should consist of 12 digits
9-
* The first digit should be 1, 2, or 3
10-
* The extracted birthdate should be a valid date
11-
* The checksum should be equal to the last digit of the Civil ID
6+
Checks the validity of a Kuwaiti Civil ID number by verifying the following:
7+
8+
* The number should consist of 12 digits
9+
* The first digit should be 1, 2, or 3
10+
* The extracted birthdate should be a valid date
11+
* The checksum should be equal to the last digit of the Civil ID
1212
"""
1313
# Civil ID can only start with 1, 2, or 3 till year 2100
1414
if len(cid) != 12 or not cid.isdigit() or cid[0] not in ('1', '2', '3'):
@@ -36,7 +36,7 @@ def get_birthdate_from_civil_id(cid):
3636
by_century = {
3737
'1': '18',
3838
'2': '19',
39-
'3': '20'
39+
'3': '20',
4040
}
4141
if cid[0] not in ('1', '2', '3'):
4242
raise ValueError('Invalid first digit')

0 commit comments

Comments
 (0)