[virtualcommons-svn] commit/vcweb: 2 new changesets
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-08-10 00:55:15
|
2 new changesets in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/8843127f07ea/ changeset: 8843127f07ea user: alllee date: 2011-08-10 00:42:29 summary: fixing activity list w/ authentication (hopefully) affected #: 1 file (166 bytes) --- a/vcweb/lighterprints/views.py Tue Aug 09 14:50:02 2011 -0700 +++ b/vcweb/lighterprints/views.py Tue Aug 09 15:42:29 2011 -0700 @@ -30,12 +30,14 @@ activity_as_dict = {} for attr_name in ('pk', 'name', 'summary', 'display_name', 'description', 'savings', 'url', 'available_all_day', 'level', 'group_activity', 'icon_url', 'time_remaining'): activity_as_dict[attr_name] = getattr(activity, attr_name, None) - if self.request.user.is_authenticated(): - # authenticated request, figure out if this activity is available - experiment_id = self.request.GET.get('experiment_id') - participant = self.request.user.participant - experiment = get_object_or_404(Experiment, pk=experiment_id) - activity_as_dict['availability'] = is_activity_available(participant=participant, experiment=experiment, activity=activity) + try: + if self.request.user.is_authenticated(): + # authenticated request, figure out if this activity is available + participant_group_relationship_id = self.request.GET.get('participant_group_relationship_id') + participant_group_relationship = get_object_or_404(ParticipantGroupRelationship, pk=participant_group_relationship_id) + activity_as_dict['availability'] = is_activity_available(activity, participant_group_relationship) + except Exception as e: + logger.debug("failed to get authenticated activity list: %s", e) flattened_activities.append(activity_as_dict) context['activity_by_level'] = dict(activity_by_level) http://bitbucket.org/virtualcommons/vcweb/changeset/d9486415c937/ changeset: d9486415c937 user: alllee date: 2011-08-10 02:15:04 summary: re-enabling start round on experimenter monitor page affected #: 1 file (296 bytes) --- a/vcweb/core/templates/experimenter/monitor.html Tue Aug 09 15:42:29 2011 -0700 +++ b/vcweb/core/templates/experimenter/monitor.html Tue Aug 09 17:15:04 2011 -0700 @@ -158,13 +158,8 @@ <li><a class='confirm-experiment-action' name='end_round' href='end-round' title='Stops the current round.'><span class='vcweb-icon icon-left ui-icon' style='background: url({{STATIC_URL}}images/famfamfam/control_stop_blue.png);' ></span>end round</a></li> {% else %} - {% comment %} - FIXME: disabling for the time being, I have a suspicion Veronika - might be clicking it accidentally and redoing rounds (thus - applying group harvest + regrowth twice) <li><a class='confirm-experiment-action' name='start_round' href='start-round' title='Starts the round.'><span class='ui-icon vcweb-icon icon-left' style='background:url({{STATIC_URL}}images/famfamfam/control_play_blue.png);' ></span>start round</a></li> - {% endcomment %} {% endif %} <li><a class='confirm-experiment-action' name='advance_to_next_round' href='advance-to-next-round' title='Stops the current round if necessary and advances to the next round.'><span class='vcweb-icon ui-icon icon-left' style='background:url({{STATIC_URL}}images/famfamfam/control_fastforward_blue.png);' ></span>advance to next round</a></li> Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |