forked from enviPath/enviPy
wip
This commit is contained in:
+5
-2
@@ -211,7 +211,7 @@ class UserManager(object):
|
||||
# Create package
|
||||
package_name = f"{u.username}{'’' if u.username[-1] in 'sxzß' else 's'} Package"
|
||||
package_description = "This package was generated during registration."
|
||||
p = PackageManager.create_package(u, package_name, package_description)
|
||||
p = PackageManager.create_package(u, package_name, package_description, shareable=False)
|
||||
u.default_package = p
|
||||
u.save()
|
||||
|
||||
@@ -547,7 +547,7 @@ class PackageManager(object):
|
||||
|
||||
@staticmethod
|
||||
@transaction.atomic
|
||||
def create_package(current_user, name: str, description: str = None):
|
||||
def create_package(current_user, name: str, description: str = None, *args, **kwargs):
|
||||
p = Package()
|
||||
|
||||
# Clean for potential XSS
|
||||
@@ -556,6 +556,9 @@ class PackageManager(object):
|
||||
if description is not None and description.strip() != "":
|
||||
p.description = nh3.clean(description.strip(), tags=s.ALLOWED_HTML_TAGS).strip()
|
||||
|
||||
if "shareable" in kwargs:
|
||||
p.shareable = kwargs["shareable"]
|
||||
|
||||
p.save()
|
||||
|
||||
up = UserPackagePermission()
|
||||
|
||||
Reference in New Issue
Block a user