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