diff options
-rw-r--r-- | bot/ircmeeting/agenda.py | 5 | ||||
-rw-r--r-- | bot/ircmeeting/meeting.py | 2 | ||||
-rw-r--r-- | site/app/controllers/agendas_controller.rb | 2 | ||||
-rw-r--r-- | site/app/models/agenda.rb | 6 | ||||
-rw-r--r-- | site/db/schema.rb | 3 | ||||
-rw-r--r-- | site/spec/models/agenda_spec.rb | 10 |
6 files changed, 23 insertions, 5 deletions
diff --git a/bot/ircmeeting/agenda.py b/bot/ircmeeting/agenda.py index a77aafe..05e4a57 100644 --- a/bot/ircmeeting/agenda.py +++ b/bot/ircmeeting/agenda.py @@ -217,10 +217,11 @@ class Agenda(object): result = str.format(self.timelimit_missing_msg, message) return(result) - def post_result(self): + def post_result(self, lines): if not self.conf.manage_agenda: return('') - data_dict = {'votes' : self._votes, 'agenda' : self._agenda} + data_dict = {'votes' : self._votes, 'agenda' : self._agenda, + 'lines' : "\n".join(lines)} data = urllib.quote(json.dumps(data_dict)) result_url = str.format(self.conf.result_url, self.conf.voting_results_user, diff --git a/bot/ircmeeting/meeting.py b/bot/ircmeeting/meeting.py index a86c782..a15b674 100644 --- a/bot/ircmeeting/meeting.py +++ b/bot/ircmeeting/meeting.py @@ -380,7 +380,7 @@ class MeetingCommands(object): for messageline in message.split('\n'): self.reply(messageline) self._meetingIsOver = True - self.config.agenda.post_result() + self.config.agenda.post_result(self.lines) def do_topic(self, nick, line, **kwargs): """Set a new topic in the channel.""" if not self.isChair(nick): return diff --git a/site/app/controllers/agendas_controller.rb b/site/app/controllers/agendas_controller.rb index 18a178d..669f364 100644 --- a/site/app/controllers/agendas_controller.rb +++ b/site/app/controllers/agendas_controller.rb @@ -17,6 +17,8 @@ class AgendasController < ApplicationController data = JSON.parse(request.env["rack.input"].read) Agenda.update_voting_options data['agenda'] Agenda.process_results data data['votes'] + agenda = Agenda.current + agenda.meeting_log = data['lines'] Participation.mark_participations data end diff --git a/site/app/models/agenda.rb b/site/app/models/agenda.rb index 4a02dbb..c15b12e 100644 --- a/site/app/models/agenda.rb +++ b/site/app/models/agenda.rb @@ -5,6 +5,7 @@ class Agenda < ActiveRecord::Base fields do meeting_time :datetime email_reminder_sent :boolean, :null => false, :default => false + meeting_log :text, :null => false, :default => '' timestamps end @@ -32,7 +33,10 @@ class Agenda < ActiveRecord::Base end def update_permitted? - acting_user.council_member? || acting_user.administrator? + return false if meeting_log_changed? + return true if acting_user.council_member? + return true if acting_user.administrator? + false end def destroy_permitted? diff --git a/site/db/schema.rb b/site/db/schema.rb index bc8535a..39dd08b 100644 --- a/site/db/schema.rb +++ b/site/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110624141720) do +ActiveRecord::Schema.define(:version => 20110627151021) do create_table "agenda_items", :force => true do |t| t.string "title" @@ -34,6 +34,7 @@ ActiveRecord::Schema.define(:version => 20110624141720) do t.string "state", :default => "open" t.datetime "key_timestamp" t.boolean "email_reminder_sent", :default => false, :null => false + t.text "meeting_log", :default => "", :null => false end add_index "agendas", ["state"], :name => "index_agendas_on_state" diff --git a/site/spec/models/agenda_spec.rb b/site/spec/models/agenda_spec.rb index 05212d0..f1de822 100644 --- a/site/spec/models/agenda_spec.rb +++ b/site/spec/models/agenda_spec.rb @@ -31,6 +31,16 @@ describe Agenda do end end + it 'should allow no one to edit or change meeting_log' do + a = Factory(:agenda) + a.meeting_log = 'changed' + + for u in users_factory(AllRoles) + a.should_not be_editable_by(u, :meeting_log) + a.should_not be_updatable_by(u) + end + end + def test_migration(object, migration, prohibited, allowed, final_state) # object - object to migrate # migration - migration name |