From: root Date: Sat, 25 Jan 2014 05:06:38 +0000 Subject: remove last active user X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-agls.git&a=commitdiff&h=d6a05712aba9740f2d96c9a273edd40aa757c077 --- remove last active user --- --- a/ckanext/agls/plugin.py +++ b/ckanext/agls/plugin.py @@ -10,18 +10,6 @@ from sqlalchemy import orm import ckan.model -#parse the activity feed for last active non-system user -def get_last_active_user(id): - system_user = lib.helpers.get_action('user_show',{'id': config.get('ckan.site_id', 'ckan_site_user')}) - user_list = [x for x in lib.helpers.get_action('package_activity_list',{'id':id}) if x['user_id'] != system_user['id']] - user = None - if len(user_list) > 0: - user = user_list[0].get('user_id', None) - if user is None: - return system_user - else: - return lib.helpers.get_action('user_show',{'id':user}) - class AGLSPlugin(plugins.SingletonPlugin, tk.DefaultDatasetForm): '''An example IDatasetForm CKAN plugin. @@ -31,7 +19,6 @@ ''' plugins.implements(plugins.IConfigurer, inherit=False) plugins.implements(plugins.IDatasetForm, inherit=False) - plugins.implements(plugins.ITemplateHelpers, inherit=False) def update_config(self, config): # Add this plugin's templates dir to CKAN's extra_template_paths, so @@ -44,8 +31,6 @@ tk.add_resource('theme/public', 'ckanext-agls') # config['licenses_group_url'] = 'http://%(ckan.site_url)/licenses.json' - def get_helpers(self): - return {'get_last_active_user': get_last_active_user} def is_fallback(self): # Return True to register this plugin as the default handler for --- a/ckanext/agls/templates/package/read.html +++ b/ckanext/agls/templates/package/read.html @@ -100,13 +100,6 @@ {% endif %} -{% set email =h.get_last_active_user(c.pkg_dict['id']).get('email','') %} - - {{ _('Maintainer') }} - {{ - h.mail_to(email_address=(email or ' '), name=h.get_last_active_user(c.pkg_dict['id']).get("display_name",'')) }} - - Publisher/Agency {{ c.pkg_dict['organization']['title']}} --- a/ckanext/agls/templates/package/read.rdf +++ b/ckanext/agls/templates/package/read.rdf @@ -74,13 +74,6 @@ ${ c.pkg_dict['organization']['title'] } - - - ${h.get_last_active_user(c.pkg_dict['id'])["display_name"]} - - -