Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
simplifying
Browse files Browse the repository at this point in the history
  • Loading branch information
foxmask committed Nov 20, 2017
1 parent 01a6be1 commit fdefa7b
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions th_taiga/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,31 +259,6 @@ def data_filter(trigger_id, **data):
return data


def consumer(trigger_id, data):
"""
call the consumer and handle the data
:param trigger_id:
:param data:
:return:
"""
status = True
# consumer - the service which uses the data
default_provider.load_services()
service = TriggerService.objects.get(id=trigger_id)

service_consumer = default_provider.get_service(
str(service.consumer.name.name))
kwargs = {'user': service.user}

if len(data) > 0:

getattr(service_consumer, '__init__')(service.consumer.token,
**kwargs)
status = getattr(service_consumer, 'save_data')(service.id, **data)

return status


def verify_signature(data, key, signature):
mac = hmac.new(key.encode("utf-8"), msg=data, digestmod=hashlib.sha1)
return mac.hexdigest() == signature
Expand Down

0 comments on commit fdefa7b

Please sign in to comment.