[12:35] mhall119, do you know why this http://pastebin.com/iN59biEq returns MultipleObjectsReturned ? [12:36] daker: duplicate event titles with the same user attending both [12:37] this is very likely to happen with events like "Ubuntu Hour" [12:37] mhall119, how did you fix it ? [12:37] what are you trying to accomplish? [12:39] well i am trying to use get_or_create, if there is an event it's ok if not create one [12:39] event, created = Event.objects.get_or_create(title=title, attendees__name__in=users) [12:39] you'll need to give enough fields to uniquely identify a record [12:39] if title isn't a unique field, you'll need something else [12:41] you can look at loco_directory/common/management/commands/recoverdata.py to see how I was doing it for the recovery script [12:42] ok [12:43] if you might have more than one match, then you should to an if not Event.objects.filter(foo=bar).exists(): [12:43] and then create one [12:43] the problem is that the sql query return two rows [12:44] right, and .get and .get_or_create will throw an error if it matches more than one [12:45] it returns two rows because of attendees__name__in=users [12:45] hang on, is it returning 2 copies of the same Event recort? [12:45] record [12:45] or 2 different Event records? [12:46] 2 records of the same event [12:46] oh, ok..... [12:46] imagine you an event and daker & mhall119 are attending and [12:47] users = [u'daker', u'mhal119'] [12:47] event, created = Event.objects.get(title=title, attendees__name__in=users) [12:47] this will gives two records of the same events [12:47] -s [12:47] ok, then I'm not sure how to fix that [12:48] probably the ManyToMany relationship is making that do unexpected things [12:49] yeah [12:55] so then you might need to do the filter().exists() check first, and if nothing matches then to an .objects.create() [12:56] ok [19:04] nigelb: ping [19:04] pong [19:04] nigelb: I added another test case to https://code.launchpad.net/~mhall119/summit/scheduling-testcase/+merge/73926 [19:05] this one checks that we're not mixing private/public rooms and meetings [19:05] man, I wish you pinged this to mee when I wasn't sleepy. [19:05] it's currently failing, because we haven't made the autoscheduler aware of private rooms yet [19:05] you're always sleepy :P [19:05] its 0030. I should be sleeping. [19:05] But I'm a sysadmin. [19:06] boo [19:06] just mark it approved so it'll land, it's only test cases [19:06] as long as your signature is on it, I'm happy [19:06] mhall119: I'd like to run the tests to make sure they pass before I approve. [19:07] oh wait. [19:07] I just said they don't pass [19:07] it fails. [19:07] boo. [19:07] the MP is only to add test cases, not new functionality [19:08] go [19:08] done [19:08] haha, sucker [19:08] I mean, thanks nigelb [19:08] lol [20:03] nigelb or cjohnston: https://code.launchpad.net/~mhall119/summit/fix-etherpad-edit-links/+merge/75061 [20:03] that fixed the annoying reverse lookup errors we'd had [20:05] cjohnston: we need the private scheduling test cases passing before we can deploy what's in trunk [20:05] I'll probably add more to them too [20:08] that's not idea [20:08] l [20:09] can I help in making trunk deployable again? [20:10] I'm being asked for changes that we would want deployed quickly, and so having that blocked isn't good for us [20:11] james_w: we just need to update the autoschedule/reschedule code to be aware of private rooms and not try to schedule public meetings into them [20:11] private is a flag? [20:11] for uds-p, I'd be okay if we just plain didn't auto-schedule private meetings or private rooms [20:11] it's not a type like "openly scheduled"? [20:11] type='private' [20:12] meetings have a private=True field [20:12] mhall119: that's like a one-line changing? [20:12] but rooms use a type [20:12] nigelb: possibly [20:12] *change [20:12] I just wrote the tests for it [20:12] you're more familiar with the scheduler itself [20:12] I'll take a look [20:12] TDD [20:13] Is the code that got chcked in that UDS? [20:13] Or was that rescheduler? :P [20:13] that was reschedule [20:15] I don't see a test failure on trunk? [20:16] it's not in trunk yet [20:16] wait, yes it is [20:16] you're not seeing a failure? [20:17] nope [20:17] lol. [20:17] WIN. [20:17] :( [20:17] james_w: how are you running the tests? [20:18] def try_schedule(self): [20:18] """Try to schedule this meeting in a suitable room.""" [20:18] open_rooms = self.summit.room_set.filter(type__exact='open') [20:18] ./manage.py test [20:18] so autoschedule already skips private rooms [20:20] it does look like it will happily schedule private sessions in to public rooms though [20:20] yeah [20:20] and I'm not really sure what reschedule should do [20:21] given that you can only schedule private rooms manually it should never delete an agenda item for one, so I think we're fine there too [20:21] oh, my tests are wrong [20:22] nigelb: I can't believe you approved bad tests [20:22] mhall119: under threat and duress [20:24] a likely excuse === Ronnie2 is now known as Ronnie [20:38] james_w: can you merge in lp:~mhall119/summit/fixes-to-private-scheduling-tests and see if you get failing tests [20:41] I'm still getting one test that fails, looks like a private meeting is being autoscheduled into an open room [20:41] still no failure [20:41] are you running in a virtualenv? [20:42] no [20:42] maybe that's the difference....but they should still fail [20:42] well, the one should [20:42] seems it's not running these tests? [20:42] try python manage.py test schedule.PrivateSchedulingTestCase [20:43] ValueError: Test label 'schedule.PrivateSchedulingTestCase' does not refer to a test [20:43] well....that's interesting [20:43] so you see that in summit/schedule/tests.py ? === Ronnie1 is now known as Ronnie [20:45] hmm, looks like it may be a missing dependency [20:45] model_mommy [20:45] yeah, surprised that didn't throw an error for you though [20:46] again django's test infrastructure leaves a lot to be desired [20:46] model_mommy doesn't seem to be packaged? [20:46] you can install it with pip [20:46] best to setup a virtualenv [20:47] then pip install -r requirements.txt from within that [21:09] getting errors installing the requirements in a virtualenv [21:09] :/ [21:09] on what? [21:09] first BeautifulSoup [21:10] which I just deleted from the file [21:10] I don't think we need that anymore [21:10] no psycopg2 [21:10] no? [21:10] warning: manifest_maker: standard file '-c' not found [21:10] error: No such file or directory [21:10] now, sorry [21:10] oh, I think that needs dev headers installed system-wide [21:10] do you have python-dev? [21:11] (gah, to slow :P) [21:11] *too [21:11] james_w: I think you need libpq-dev [21:11] do compile the postgres driver for the virtualenv [21:12] pq or pg? [21:12] pq [21:12] weird, I know [21:12] ok [21:12] I have to leave now [21:12] ok [21:12] I'll continue with this tomorrow [21:12] thanks for the help [21:13] james_w: thank you for stopping by :)