Skip to content

Commit

Permalink
Remove ALLOWED_FIELDS
Browse files Browse the repository at this point in the history
  • Loading branch information
zeyneloz committed Nov 23, 2018
1 parent d35ce37 commit f7b47ae
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion onesignal/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ def csv_export(self, post_body=None):
def track_open(self, notification_id, track_body):
url = self._get_path("NOTIFICATION_PATH", id=notification_id)
track_body["app_id"] = self.app["app_id"]
return basic_auth_request('PUT', url, token=self.app["app_auth_key"], payload=track_body)
return basic_auth_request('PUT', url, token=self.app["app_auth_key"], payload=track_body)
13 changes: 0 additions & 13 deletions onesignal/constants.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
ALLOWED_FIELDS = ["contents", "included_segments", "excluded_segments", "filters", "include_player_ids",
"app_id", "app_ids", "headings", "subtitle", "template_id", "content_available", "mutable_content",
"data", "url", "ios_attachments", "big_picture", "adm_big_picture", "chrome_big_picture", "buttons",
"web_buttons", "ios_category", "android_background_layout", "small_icon", "large_icon",
"adm_small_icon",
"adm_large_icon", "chrome_web_icon", "chrome_web_image", "firefox_icon", "chrome_icon", "ios_sound",
"android_sound", "android_led_color", "android_accent_color", "android_visibility", "adm_sound",
"ios_badgeType",
"ios_badgeCount", "collapse_id", "send_after", "delayed_option", "delivery_time_of_day", "ttl",
"priority",
"android_group", "android_group_message", "adm_group", "adm_group_message", "isIos", "isAndroid",
"isAnyWeb", "isChromeWeb", "isFirefox", "isSafari", "isWP", "isWP_WNS", "isAdm", "isChrome"]

ENDPOINTS = {
"API_ROOT": "https://onesignal.com/api/v1",
"NOTIFICATIONS_PATH": "/notifications",
Expand Down
8 changes: 0 additions & 8 deletions onesignal/notification.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from .constants import ALLOWED_FIELDS
from .error import OneSignalError


class Notification:
def __init__(self, contents=None):
self.post_body = {"contents": contents}
Expand All @@ -18,10 +14,6 @@ def set_parameter(self, name, value):
"""
if name[0] == "!":
name = name[1:]
elif name not in ALLOWED_FIELDS:
raise OneSignalError(("This field name is not present in documentation. "
"But if you are sure to add it, you should add a exclamation mark (!) to set it. "
"Example usage: !{0}").format(name))
self.post_body[name] = value

def set_included_segments(self, included_segments):
Expand Down

0 comments on commit f7b47ae

Please sign in to comment.