Skip to content

Commit

Permalink
Replace use of 'os.sep' in url path parts with optimized rule lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
datakurre committed Jul 10, 2018
1 parent 6fd6986 commit cb9d181
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/collective/ifttt/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

from Acquisition import aq_parent
from collective.ifttt import _
from plone import api
Expand All @@ -11,8 +10,6 @@
from zope.component import getMultiAdapter
from zope.component import getUtility

import os


class Rules(object):
"""Define content rule operations within collective.ifttt environment"""
Expand Down Expand Up @@ -87,9 +84,7 @@ def configure_rule(self, data):
self.rule_id = storage.values()[-1].id

# traverse to configuration page of content rule
portal = api.portal.get().__name__
rule_url = (os.sep).join(('', portal, self.rule_id))
rule = self.context.restrictedTraverse(rule_url)
rule = api.portal.get().restrictedTraverse(self.rule_id)

# add conditions to rule
self.add_condition(data, rule)
Expand Down

0 comments on commit cb9d181

Please sign in to comment.