Ejemplo n.º 1
0
def save_flowgram(request, flowgram, description, public, title, sent_owner_done_email, \
                      background_audio_loop, background_audio_volume, tags):
    if permissions.can_edit(request.user, flowgram):
        flowgram.description = description
        if public and not flowgram.public:
            flowgram.published_at = datetime.now()
        flowgram.public = public
        flowgram.title = title
        flowgram.sent_owner_done_email = sent_owner_done_email
        flowgram.background_audio_loop = background_audio_loop
        flowgram.background_audio_volume = background_audio_volume
        flowgram.save()
    
    if localsettings.FEATURE['subscriptions_fw']:
        data = {'fg_id': flowgram.id,
                'eventCode': 'FG_MADE'}
        data['active'] = 'make_active' if public else 'make_inactive'
        controller.store_fgmade_event(data)

    if request.POST.has_key('tags'):
        controller.set_tags(request.user, flowgram, tags)
        if localsettings.FEATURE['subscriptions_fw']:
            controller.store_fgtagged_event({'current_user': request.user,
                                            'fg_id': flowgram.id,
                                            'eventCode': 'FG_TAGGED'})
Ejemplo n.º 2
0
def change_privacy(request, flowgram, public):
    flowgram.public = public
    flowgram.save()

    if localsettings.FEATURE['subscriptions_fw']:
        data = {'fg_id': flowgram.id,
                'eventCode': 'FG_MADE'}
        data['active'] = 'make_active' if public else 'make_inactive'

        controller.store_fgmade_event(data)