Skip to content

Commit

Permalink
Restructure templates and modify auth functions
Browse files Browse the repository at this point in the history
  • Loading branch information
blagojabozinovski committed Jul 16, 2024
1 parent 9e87f22 commit 27f6e40
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ckanext/bulkupload/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import ckan.plugins.toolkit as toolkit


def bulk_resource_upload(context, data_dict):
userobj = context.get('auth_user_obj')
if not userobj:
raise toolkit.NotAuthorized
return {'success': False}


def package_busoperator(context, data_dict):
userobj = context.get('auth_user_obj')
if not userobj:
raise toolkit.NotAuthorized
return {'success': False}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ form.input('date-start', type='date', id='field-date-start', label=_('Date start'), value='', error='') }}
<div style="margin:-20px 0px 20px 0px;"><small>{{ form.info('Date start') }}</small></div>
{{ form.input('date-end', type='date', id='field-date-end', label=_('Date end'), value='', error='') }}
<div style="margin:-20px 0px 20px 0px;"><small>{{ form.info('Date start') }}</small></div>
<div style="margin:-20px 0px 20px 0px;"><small>{{ form.info('Date end') }}</small></div>


<div class="form-group control-medium">
Expand Down
4 changes: 3 additions & 1 deletion ckanext/bulkupload/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def package_busoperator():
'org_list': org_list,
}

return base.render('package_busoperator.html', extra_var)
return base.render('package/package_busoperator.html', extra_var)

elif flask.request.method == 'POST':
context = {
Expand All @@ -80,6 +80,8 @@ def package_busoperator():
'private': False,
'status': 'active',
'owner_org': form_data['owner_org'],
'dataset_start_date': form_data['date-start'],
'dataset_end_date': form_data['date-end'],
}
try:
x = tk.get_action("package_create")(context, data_dict)
Expand Down

0 comments on commit 27f6e40

Please sign in to comment.