Skip to content
Permalink
Browse files
bug fix: improve size for smtphost
  • Loading branch information
usmannasir committed Sep 15, 2020
1 parent 6e076aa commit 935293621febdc873650744dec5faaeaa2595a6e
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
@@ -62,24 +62,42 @@ def submitWebsiteCreation(self):
try:

try:
selectedACL = ACL.objects.get(name='user')

UserAccountName = self.data['UserAccountName']
UserPassword = self.data['UserPassword']
FullName = self.data['FullName']
token = hashPassword.generateToken(UserAccountName, UserPassword)
password = hashPassword.hash_password(UserPassword)

try:
initWebsitesLimit = int(self.data['websitesLimit'])
except:
initWebsitesLimit = 10

try:
acl = self.data['acl']
selectedACL = ACL.objects.get(name=acl)

except:
selectedACL = ACL.objects.get(name='user')

try:
apiAccess = int(self.data['api'])
except:
apiAccess = 10

try:
newAdmin = Administrator(firstName=FullName,
lastName="",
email=self.data['adminEmail'],
type=3,
userName=UserAccountName,
password=password,
initWebsitesLimit=10,
initWebsitesLimit=initWebsitesLimit,
owner=1,
acl=selectedACL,
token=token
token=token,
api=apiAccess
)
newAdmin.save()
except BaseException as msg:
@@ -29,8 +29,8 @@ class SMTPHosts(models.Model):
owner = models.ForeignKey(Administrator, on_delete=models.CASCADE)
host = models.CharField(max_length=150, unique= True)
port = models.CharField(max_length=10)
userName = models.CharField(max_length=50)
password = models.CharField(max_length=50)
userName = models.CharField(max_length=200)
password = models.CharField(max_length=200)

class EmailTemplate(models.Model):
owner = models.ForeignKey(Administrator, on_delete=models.CASCADE)
@@ -622,6 +622,16 @@ def applyLoginSystemMigrations():
except:
pass

try:

This comment has been minimized.

Copy link
@usmannasir

usmannasir Sep 15, 2020

Author Owner
cursor.execute("ALTER TABLE emailMarketing_smtphosts MODIFY userName varchar(200)")
except:
pass

try:
cursor.execute("ALTER TABLE emailMarketing_smtphosts MODIFY password varchar(200)")
except:
pass

try:
cursor.execute("ALTER TABLE websiteFunctions_backups MODIFY fileName varchar(200)")
except:
@@ -438,12 +438,31 @@ def submitUserDeletion(request):

accountUsername = data['accountUsername']

try:
force = data['force']
except:
force = 0


currentACL = ACLManager.loadedACL(userID)

currentUser = Administrator.objects.get(pk=userID)
userInQuestion = Administrator.objects.get(userName=accountUsername)


if ACLManager.checkUserOwnerShip(currentACL, currentUser, userInQuestion):


if force:
userACL = ACLManager.loadedACL(userInQuestion.pk)
websitesName = ACLManager.findAllSites(userACL, userInQuestion.pk)

from websiteFunctions.website import WebsiteManager
wm = WebsiteManager()

for website in websitesName:
wm.submitWebsiteDeletion(userID, {'websiteName': website})

user = Administrator.objects.get(userName=accountUsername)

childUsers = Administrator.objects.filter(owner=user.pk)

0 comments on commit 9352936

Please sign in to comment.