Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lmfdb/modular_curves/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,13 @@ def modcurve_lmfdb_label(label):
return lmfdb_label, label_type

def modcurve_jump(info):
labels = (info["jump"]).split("*")
jump = info["jump"]
# Since several modular curves can share the same Cummins-Pauli label,
# we redirect to the search results listing all of them when the match
# is not unique
if CP_LABEL_RE.fullmatch(jump) and db.gps_gl2zhat_fine.count({"CPlabel": jump}) > 1:
return redirect(url_for(".index_Q", CPlabel=jump))
labels = jump.split("*")
lmfdb_labels = []
for label in labels:
lmfdb_label, label_type = modcurve_lmfdb_label(label)
Expand Down
7 changes: 7 additions & 0 deletions lmfdb/modular_curves/test_modular_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,18 @@ def test_jump(self):
('32.1536.41.1175','32.1536.41-32.bz.3.6'),
('7B.6.2','7.24.0.b.1'),
('4E0-8b','8.12.0.a.1'),
('100A7','100.120.7.a.1'), # CP label matching a unique curve
('banana','Error: There is no modular curve in the database')
]
for j,l in jump_set:
L = self.tc.get("/ModularCurve/Q/?jump=%s" % j,follow_redirects=True)
assert l in L.get_data(as_text=True)
# A CP label shared by several curves redirects to the search results listing all of them
L = self.tc.get("/ModularCurve/Q/?jump=113A17",follow_redirects=True)
text = L.get_data(as_text=True)
assert "Modular curve search results" in text
for l in ['113.228.17.a.1','113.228.17.a.2']:
assert l in text

def test_related_objects(self):
for url, friends in [
Expand Down
Loading