Minor improvements and bugfixes
This commit is contained in:
parent
1c8340a089
commit
f8d66dc400
|
@ -5,24 +5,14 @@ import db
|
|||
|
||||
def is_adquired(pkg_dict):
|
||||
|
||||
adquired = False
|
||||
|
||||
if db.package_allowed_users_table is None:
|
||||
db.init_db(model)
|
||||
|
||||
if db.AllowedUser.get(package_id=pkg_dict['id'], user_name=tk.c.user):
|
||||
adquired = True
|
||||
|
||||
return adquired
|
||||
return len(db.AllowedUser.get(package_id=pkg_dict['id'], user_name=tk.c.user)) > 0
|
||||
|
||||
|
||||
def is_owner(pkg_dict):
|
||||
|
||||
owner = False
|
||||
if tk.c.userobj.id == pkg_dict['creator_user_id']:
|
||||
owner = True
|
||||
|
||||
return owner
|
||||
return tk.c.userobj.id == pkg_dict['creator_user_id']
|
||||
|
||||
|
||||
def get_allowed_users_str(users):
|
||||
|
|
|
@ -151,6 +151,7 @@ class PrivateDatasets(p.SingletonPlugin, tk.DefaultDatasetForm):
|
|||
db.init_db(context['model'])
|
||||
|
||||
# Get the users and the package ID
|
||||
if 'allowed_users' in pkg_dict:
|
||||
received_users = [allowed_user for allowed_user in pkg_dict['allowed_users']]
|
||||
package_id = pkg_dict['id']
|
||||
|
||||
|
|
Loading…
Reference in New Issue