10000 Validate property values · nnevalainen/server-client-python@79c355a · GitHub
[go: up one dir, main page]

Skip to content

Commit 79c355a

Browse files
committed
Validate property values
1 parent d205b4c commit 79c355a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tableauserverclient/models/data_alert_item.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import xml.etree.ElementTree as ET
22

3-
from .property_decorators import property_not_empty, property_is_enum
3+
from .property_decorators import property_not_empty, property_is_enum, property_is_boolean
44
from .user_item import UserItem
55
from .view_item import ViewItem
66

77

88
class DataAlertItem(object):
99
class Frequency:
10-
Once = 'once'
11-
Frequently = 'frequently'
12-
Hourly = 'hourly'
13-
Daily = 'daily'
14-
Weekly = 'weekly'
10+
Once = 'Once'
11+
Frequently = 'Frequently'
12+
Hourly = 'Hourly'
13+
Daily = 'Daily'
14+
Weekly = 'Weekly'
1515

1616
def __init__(self):
1717
self._id = None
@@ -62,7 +62,7 @@ def public(self):
6262
return self._public
6363

6464
@public.setter
65-
@property_not_empty
65+
@property_is_boolean
6666
def public(self, value):
6767
self._public = value
6868

tableauserverclient/server/request_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def update_req(self, alert_item):
9898
xml_request = ET.Element('tsRequest')
9999
dataAlert_element = ET.SubElement(xml_request, 'dataAlert')
100100
dataAlert_element.attrib['subject'] = alert_item.subject
101-
dataAlert_element.attrib['frequency'] = alert_item.frequency
101+
dataAlert_element.attrib['frequency'] = alert_item.frequency.lower()
102102
dataAlert_element.attrib['public'] = alert_item.public
103103

104104
owner = ET.SubElement(dataAlert_element, 'owner')

0 commit comments

Comments
 (0)
0