[virtualcommons-svn] commit/vcweb: alllee: fixing generic instructions view
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-07-08 23:09:06
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/25c452d64b69/ changeset: 25c452d64b69 user: alllee date: 2011-07-09 01:08:54 summary: fixing generic instructions view affected #: 2 files (352 bytes) --- a/vcweb/core/urls.py Fri Jul 08 13:09:42 2011 -0700 +++ b/vcweb/core/urls.py Fri Jul 08 16:08:54 2011 -0700 @@ -11,7 +11,6 @@ url(r'^accounts/logout/$', login_required(LogoutView.as_view()), name='logout'), url(r'^accounts/register/$', RegistrationView.as_view(), name='register'), url(r'^accounts/profile/$', 'account_profile', name='profile'), - url(r'^participate/(?P<pk>\d+)/instructions', 'instructions', name='instructions'), url(r'^participate/(?P<namespace>\w+)/instructions', 'instructions', name='namespace_instructions'), url(r'^experiment/(?P<pk>\d+)/monitor$', MonitorExperimentView.as_view(), name='monitor_experiment'), url(r'^experiment/(?P<pk>\d+)/register-email-list$', RegisterEmailListView.as_view(), name='register_email_list'), --- a/vcweb/core/views.py Fri Jul 08 13:09:42 2011 -0700 +++ b/vcweb/core/views.py Fri Jul 08 16:08:54 2011 -0700 @@ -179,18 +179,13 @@ return super(ParticipantMixin, self).dispatch(*args, **kwargs) @login_required -def instructions(request, pk=None, namespace=None): - if pk: - experiment = Experiment.objects.get(pk=pk) - elif namespace: - experiment = Experiment.objects.get(experiment_metadata__namespace=namespace) - - if not experiment: - logger.warning("Tried to request instructions for id %s or namespace %s", pk, namespace) +def instructions(request, namespace=None): + if namespace is not None: + return render_to_response('%s/instructions.html' % namespace, + context_instance=RequestContext(request)) + else: return redirect('home') - return render_to_response(experiment.get_template_path('instructions.html'), locals(), context_instance=RequestContext(request)) - """ experimenter views FIXME: add has_perms authorization to ensure that only experimenters can access 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. |