2020-02-03 09:44:33 +00:00
|
|
|
def update_tag(event, context):
|
|
|
|
import logging
|
|
|
|
|
|
|
|
logger = logging.getLogger('music')
|
|
|
|
|
2020-02-03 11:51:46 +00:00
|
|
|
if event.get('attributes'):
|
|
|
|
if 'username' in event['attributes'] and 'tag_id' in event['attributes']:
|
2020-06-30 16:38:06 +01:00
|
|
|
|
|
|
|
from music.tasks.update_tag import update_tag as do_update_tag
|
2020-02-03 11:51:46 +00:00
|
|
|
do_update_tag(username=event['attributes']['username'], tag_id=event['attributes']["tag_id"])
|
2020-06-30 16:38:06 +01:00
|
|
|
|
2020-02-03 11:51:46 +00:00
|
|
|
else:
|
|
|
|
logger.error('no parameters in event attributes')
|
2020-02-03 09:44:33 +00:00
|
|
|
else:
|
2020-02-03 11:51:46 +00:00
|
|
|
logger.error('no attributes in event')
|