Skip to content

Commit 9f8cd33

Browse files
committed
Fix conflict for merge PR MongoEngine#726
2 parents f066e28 + 1c5898d commit 9f8cd33

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,4 @@ that much better:
207207
* Bruno Rocha (https://github.com/rochacbruno)
208208
* Norberto Leite (https://github.com/nleite)
209209
* Bob Cribbs (https://github.com/bocribbz)
210+
* Jay Shirley (https://github.com/jshirley)

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Changes in 0.9.X - DEV
4646
- Workaround a dateutil bug #608
4747
- Conditional save for atomic-style operations #511
4848
- Allow dynamic dictionary-style field access #559
49+
- Increase email field length to accommodate new TLDs #726
4950
- index_cls is ignored when deciding to set _cls as index prefix #733
5051
- Allow atomic update for the entire `DictField` #742
5152

mongoengine/fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ class EmailField(StringField):
160160
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"
161161
# quoted-string
162162
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"'
163-
# domain
164-
r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,253}[A-Z0-9])?\.)+[A-Z]{2,6}$', re.IGNORECASE
163+
# domain (max length of an ICAAN TLD is 22 characters)
164+
r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,253}[A-Z0-9])?\.)+[A-Z]{2,22}$', re.IGNORECASE
165165
)
166166

167167
def validate(self, value):

tests/fields/fields.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,6 +2927,9 @@ class User(Document):
29272927
"aJIazqqWkm7.net"))
29282928
self.assertTrue(user.validate() is None)
29292929

2930+
user = User(email="[email protected]")
2931+
self.assertTrue(user.validate() is None)
2932+
29302933
user = User(email='me@localhost')
29312934
self.assertRaises(ValidationError, user.validate)
29322935

0 commit comments

Comments
 (0)