mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-26 17:36:01 +03:00
[GH-ISSUE #464] Impossible to add a new simple user #448
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#448
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tonioo on GitHub (Dec 4, 2013).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/464
Originally assigned to: @tonioo on GitHub.
Originally created by Anthony Bourguignon on 2013-10-09T13:39:34Z
Hi,
It seems impossible for a domain admin to add a simple user if quota is set 0. I'm using Modoboa 1.0.1 with a postgresql database.
Here what I've done : I've created a new domain as a Super Admin. As the quota field must be set, I choose 0 (I don't want to enable quota). I gave the domain admin to another user. When he tried to add a simple user, he wasn't able to do so. If he leaves the checkbox activated to use the domain's value, he has the error "A quota is required". It's the same if he leaves it empty without the checkbox activated. If he tries to put a value, the error is "Quota is greater than the allowed domain's limit" (that part seems normal). It's impossible for him to add a user.
I think that the issue came from the file /srv/www/toniob.net/admin.mail/lib/python2.7/site-packages/modoboa/admin/models.py , in the function set_quota. The condition "if not self.quota and not override_rules" is True if quota is set to 0 (which is the case here) and the user is not a super admin.
Did I do something wrong ? I can make more tests if you need to.
Thanks
@tonioo commented on GitHub (Dec 4, 2013):
Posted by Antoine Nguyen on 2013-10-09T14:13:31Z
Hi Anthony,
it seems you found a true issue! The condition you pointed out is indeed responsible of the message you see.
Could you please try the following modification ?
diff --git a/modoboa/admin/models.py b/modoboa/admin/models.py index a822754..546182d 100644 --- a/modoboa/admin/models.py +++ b/modoboa/admin/models.py @@ -922,7 +922,7 @@ class Mailbox(DatesAware): ) else: self.quota = value - if not self.quota and not override_rules: + if not self.quota and self.domain.quota and not override_rules: raise AdminError(_("A quota is required")) def get_quota(self):@tonioo commented on GitHub (Dec 4, 2013):
Posted by Anthony Bourguignon on 2013-10-09T16:02:18Z
It's working as expected now. The creation and the update too. Thanks a lot.
@tonioo commented on GitHub (Dec 4, 2013):
Posted by Antoine Nguyen on 2013-10-12T18:23:33Z
Applied in changeset commit:f148eb2968d161dd51c1c5dd6b5e0e4387f79669.