0001-misc-allow-lowercase-letters-in-tracking-codes-26429.patch
tests/test_form_pages.py | ||
---|---|---|
1296 | 1296 |
resp = resp.forms[0].submit() |
1297 | 1297 |
assert formdef.data_class().get(formdata_id).evolution[-1].comment == 'hello world' |
1298 | 1298 | |
1299 |
# check we can also use it with lowercase letters. |
|
1300 |
# check we can still go back to it |
|
1301 |
app = get_app(pub) |
|
1302 |
resp = app.get('/') |
|
1303 |
resp.forms[0]['code'] = tracking_code.lower() |
|
1304 |
resp = resp.forms[0].submit() |
|
1305 |
assert resp.location == 'http://example.net/code/%s/load' % tracking_code.lower() |
|
1306 |
resp = resp.follow() |
|
1307 |
assert resp.location == 'http://example.net/test/%s' % formdata_id |
|
1308 | ||
1299 | 1309 |
def test_form_tracking_code_as_user(pub): |
1300 | 1310 |
user = create_user(pub) |
1301 | 1311 |
formdef = create_formdef() |
wcs/sql.py | ||
---|---|---|
1880 | 1880 | |
1881 | 1881 |
id = None |
1882 | 1882 | |
1883 |
@classmethod |
|
1884 |
def get(cls, id, **kwargs): |
|
1885 |
return super(TrackingCode, cls).get(id.upper(), **kwargs) |
|
1886 | ||
1883 | 1887 |
@guard_postgres |
1884 | 1888 |
@invalidate_substitution_cache |
1885 | 1889 |
def store(self): |
wcs/tracking_code.py | ||
---|---|---|
34 | 34 |
# self.id set at this point. |
35 | 35 |
pass |
36 | 36 | |
37 |
@classmethod |
|
38 |
def get(cls, id, **kwargs): |
|
39 |
return super(TrackingCode, cls).get(id.upper(), **kwargs) |
|
40 | ||
37 | 41 |
@classmethod |
38 | 42 |
def get_new_id(cls, create=False): |
39 | 43 |
r = random.SystemRandom() |
40 |
- |