mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
use constant for none category
This commit is contained in:
parent
c1994950ad
commit
2710bce4bd
1 changed files with 5 additions and 3 deletions
|
|
@ -8,6 +8,8 @@ class MultipleNotesServer(ServerAction):
|
|||
label = "Multiple Notes (Server)"
|
||||
description = "Add same note to multiple Asset Versions"
|
||||
|
||||
_none_category = "__NONE__"
|
||||
|
||||
def discover(self, session, entities, event):
|
||||
''' Validation '''
|
||||
valid = True
|
||||
|
|
@ -46,7 +48,7 @@ class MultipleNotesServer(ServerAction):
|
|||
category_data = []
|
||||
category_data.append({
|
||||
'label': '- None -',
|
||||
'value': 'none'
|
||||
"value": self._none_category
|
||||
})
|
||||
all_categories = session.query('NoteCategory').all()
|
||||
for cat in all_categories:
|
||||
|
|
@ -58,7 +60,7 @@ class MultipleNotesServer(ServerAction):
|
|||
'type': 'enumerator',
|
||||
'name': 'category',
|
||||
'data': category_data,
|
||||
'value': 'none'
|
||||
"value": self._none_category
|
||||
}
|
||||
|
||||
splitter = {
|
||||
|
|
@ -108,7 +110,7 @@ class MultipleNotesServer(ServerAction):
|
|||
}
|
||||
# Get category
|
||||
category_value = values['category']
|
||||
if category_value != 'none':
|
||||
if category_value != self._none_category:
|
||||
category = session.query(
|
||||
'NoteCategory where id is "{}"'.format(category_value)
|
||||
).one()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue