mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-31 02:28:09 +08:00
Use PAGE_MAXRAW in both places (refactor this after it all works perfectly)
This commit is contained in:
@@ -72,6 +72,9 @@ _cp1252 = {
|
||||
}
|
||||
|
||||
|
||||
PAGE_MAXRAW = 10**15
|
||||
|
||||
|
||||
def format_bool(b):
|
||||
if b:
|
||||
return "yes"
|
||||
@@ -964,6 +967,8 @@ class PageController(BaseUIController, SharableMixin,
|
||||
# Assume if item id is integer and less than 10**15, it's unencoded.
|
||||
try:
|
||||
decoded_id = int(item_id)
|
||||
if decoded_id >= PAGE_MAXRAW:
|
||||
raise ValueError("Identifier larger than maximum expected raw int, must be already encoded.")
|
||||
encoded_id = self.app.security.encode_id(item_id)
|
||||
except ValueError:
|
||||
# It's an encoded id.
|
||||
@@ -1006,8 +1011,6 @@ PAGE_CLASS_MAPPING = {
|
||||
'Visualization': 'Visualization'
|
||||
}
|
||||
|
||||
PAGE_MAXRAW = 10**15
|
||||
|
||||
|
||||
def _placeholderRenderForEdit(trans, item_class, item_id):
|
||||
return _placeholderRenderForSave(trans, item_class, item_id, encode=True)
|
||||
|
||||
Reference in New Issue
Block a user