Commit c3ddaadc authored by paz's avatar paz

Fix setting admin- and delivery-flags while subscribing.

parent 220eac93
......@@ -256,11 +256,13 @@ class SchleuderApiDaemon < Sinatra::Base
post '.json' do
begin
list = list(requested_list_id)
adminflag = [true, 1, '1'].include?(parsed_body['admin'])
deliveryflag = [true, 1, '1'].include?(parsed_body['delivery_enabled'])
sub = list.subscribe(
parsed_body['email'],
parsed_body['fingerprint'],
parsed_body['admin'],
parsed_body['delivery_enabled']
adminflag,
deliveryflag
)
logger.debug "subcription: #{sub.inspect}"
if sub.valid?
......
......@@ -232,8 +232,8 @@ module Schleuder
list_id: self.id,
email: email,
fingerprint: fingerprint,
admin: adminflag.presence || false,
delivery_enabled: deliveryflag.presence || true
admin: adminflag,
delivery_enabled: deliveryflag
)
sub.save
sub
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment