Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added missing file from a previous commit

  • Loading branch information...
commit 3b9e7fc01b44aa5f980ae8a549eb3a926500cb0b 1 parent bd96390
Brian Rosner brosner authored
Showing with 29 additions and 0 deletions.
  1. +29 −0 aiteo/groups.py
29 aiteo/groups.py
View
@@ -0,0 +1,29 @@
+from django.core.exceptions import ObjectDoesNotExist
+from django.http import Http404
+
+
+
+def group_and_bridge(kwargs):
+ """
+ Given kwargs from the view (with view specific keys popped) pull out the
+ bridge and fetch group from database.
+ """
+
+ bridge = kwargs.pop("bridge", None)
+
+ if bridge:
+ try:
+ group = bridge.get_group(**kwargs)
+ except ObjectDoesNotExist:
+ raise Http404
+ else:
+ group = None
+
+ return group, bridge
+
+
+def group_context(group, bridge):
+ # @@@ use bridge
+ return {
+ "group": group,
+ }
Please sign in to comment.
Something went wrong with that request. Please try again.