wip: Resellers and limits

* We now make a difference between users that own a specific object and users that have access to a specific object
* Limits are not moved anymore (from one reseller to a domain admin) when we grant access to a domain

see #105
This commit is contained in:
Antoine Nguyen
2012-01-25 11:57:37 +01:00
parent 73cdaed057
commit 8dd717a334
15 changed files with 223 additions and 87 deletions
+14
View File
@@ -264,6 +264,20 @@ class DomainAdminPromotionForm(forms.Form):
raise forms.ValidationError(_("Unknown user"))
return self.cleaned_data["name"]
class AssignDomainsForm(forms.Form):
domains = forms.ModelMultipleChoiceField(
queryset=None,
label=ugettext_noop("Domains"),
required=True,
help_text=ugettext_noop("Select one or more domains in the list")
)
def __init__(self, user, domadmin, *args, **kwargs):
super(AssignDomainsForm, self).__init__(*args, **kwargs)
self.fields["domains"].queryset = get_user_domains_qs(user)
self.fields["domains"].initial = get_user_domains_qs(domadmin)
class ImportDataForm(forms.Form):
sourcefile = forms.FileField(label=_("Select a file"))
sepcar = forms.CharField(label=_("Separator"), max_length=1, required=False)