Skip to content

Commit 8f53f44

Browse files
committed
Added some new formats to the regex validator for patent numbers and patent application numbers. This is still not comprehensive.
- Legacy-Id: 16638
1 parent 8e313e4 commit 8f53f44

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

ietf/ipr/forms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ class Meta:
119119
r"|[A-Z][A-Z]\d{6,12}([A-Z]\d?)?"
120120
r"|[A-Z][A-Z]\d{4}(\w{1,2}\d{5,7})?"
121121
r"|[A-Z][A-Z]\d{15}"
122+
r"|[A-Z][A-Z][A-Z]\d{1,5}/\d{4}"
123+
r"|[A-Z][A-Z]\d{1,4}/\d{1,4}"
124+
r"|PCT/[A-Z][A-Z]\d{2}/\d{5}" # WO application, old
125+
r"|PCT/[A-Z][A-Z]\d{4}/\d{6}" # WO application, new
122126
r")[, ]*)+$"),
123127
message="Please enter one or more patent publication or application numbers as country code and serial number, e.g.: US62/123456 or WO2017123456." )
124128

ietf/ipr/tests.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_new_specific(self):
238238

239239
# successful post
240240
empty_outbox()
241-
r = self.client.post(url, {
241+
data = {
242242
"holder_legal_name": "Test Legal",
243243
"holder_contact_name": "Test Holder",
244244
"holder_contact_email": "test@holder.com",
@@ -258,7 +258,8 @@ def test_new_specific(self):
258258
"licensing": "royalty-free",
259259
"submitter_name": "Test Holder",
260260
"submitter_email": "test@holder.com",
261-
})
261+
}
262+
r = self.client.post(url, data)
262263
self.assertContains(r, "Your IPR disclosure has been submitted")
263264

264265
iprs = IprDisclosureBase.objects.filter(title__icontains=draft.name)
@@ -273,6 +274,19 @@ def test_new_specific(self):
273274
self.assertTrue('New IPR Submission' in outbox[0]['Subject'])
274275
self.assertTrue('ietf-ipr@' in outbox[0]['To'])
275276

277+
# Check some additional application number formats:
278+
for patent_number in [
279+
'PCT/EP2019/123456', # WO application
280+
'PCT/EP05/12345', # WO application, old
281+
'ATA123/2012', # Austria
282+
'AU2011901234', # Australia
283+
'BE2010/0912', # Belgium
284+
'CA1234567', # Canada
285+
]:
286+
data['patent_number'] = patent_number
287+
r = self.client.post(url, data)
288+
self.assertContains(r, "Your IPR disclosure has been submitted", msg_prefix="Checked patent number: %s" % patent_number)
289+
276290
def test_new_thirdparty(self):
277291
"""Add a new third-party disclosure. Note: submitter does not need to be logged in.
278292
"""

0 commit comments

Comments
 (0)