TireSwingSoftware/openassign-server — Issue #83: Room.venue_address raises when address is None
Author: mhrivnak
Created: 2012-01-22 06:49:19+00:00
State: open

The property "venue_address" on models.Room incorrectly assumes that venue will have an address. If it does not, an exception is raised.

This seems to be demonstrated already in a failing unit test. I'm not sure how this came to be checked in while failing.

```
======================================================================
ERROR: test_view (pr_services.pr_tests.TestSessionManager)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mhrivnak/git/openassign-server/pr_services/pr_tests.py", line 1313, in test_view
ret = self.session_manager.detailed_surr_view()
File "/home/mhrivnak/git/openassign-server/pr_services/testlib/__init__.py", line 75, in _wrapper
return method(token, *args, **kwargs)
File "/home/mhrivnak/git/openassign-server/pr_services/event_system/session_manager.py", line 341, in detailed_surr_view
ret = Utils.merge_queries(ret, facade.managers.RoomManager(), auth_token, ['name', 'venue_name', 'venue_address'], 'room')
File "/home/mhrivnak/git/openassign-server/pr_services/utils/__init__.py", line 90, in merge_queries
{'member' : {'id' : q2_ids}}, q2_requested_fields)
File "/home/mhrivnak/git/openassign-server/pr_services/object_manager.py", line 187, in get_filtered
result = self.Filter(self)._filter_common(auth_token, filters, field_names)
File "/home/mhrivnak/git/openassign-server/pr_services/object_manager.py", line 277, in _filter_common
return facade.subsystems.Getter(auth_token, self.my_manager, query_set, field_names).results
File "/home/mhrivnak/git/openassign-server/pr_services/gettersetter.py", line 70, in __init__
self.process(auth_token, requested_fields)
File "/home/mhrivnak/git/openassign-server/pr_services/gettersetter.py", line 78, in process
ret[f] = self.getters[f](item, f)
File "/home/mhrivnak/git/openassign-server/pr_services/gettersetter.py", line 87, in get_general
return getattr(result_object, field_name)
File "/home/mhrivnak/git/openassign-server/pr_services/pr_models.py", line 1937, in venue_address
return self.venue.address.address_dict
File "/home/mhrivnak/pythons/openassign/lib/python2.6/site-packages/django/db/models/fields/related.py", line 315, in __get__
rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
File "/home/mhrivnak/pythons/openassign/lib/python2.6/site-packages/django/db/models/query.py", line 349, in get
% self.model._meta.object_name)
DoesNotExist: Address matching query does not exist.
```