Ejemplo n.º 1
0
    def get_username(self):
        """
        Returns a UUID-based 'random' and unique username.

        This is required data for user models with a username field.
        """
        return str(uuid.uuid4())[:model_field_attr(self.user_model, 'username', 'max_length')]
Ejemplo n.º 2
0
    def get_username(self):
        """
        Returns a UUID-based 'random' and unique username.

        This is required data for user models with a username field.
        """
        return str(uuid.uuid4(
        ))[:model_field_attr(self.user_model, 'username', 'max_length')]
Ejemplo n.º 3
0
 def test_present_field(self):
     self.assertTrue(model_field_attr(User, 'username', 'max_length'))
Ejemplo n.º 4
0
 def get_username(self):
     """Returns an UUID based 'random' and unique username"""
     return unicode(uuid.uuid4(
     ))[:model_field_attr(self.user_model, 'username', 'max_length')]
Ejemplo n.º 5
0
from django.conf import settings
from django.contrib.auth.models import User

from organizations.utils import model_field_attr

ORGS_INVITATION_BACKEND = getattr(settings, 'INVITATION_BACKEND',
        'organizations.backends.defaults.InvitationBackend')

ORGS_REGISTRATION_BACKEND = getattr(settings, 'REGISTRATION_BACKEND',
        'organizations.backends.defaults.RegistrationBackend')

ORGS_NOTIFICATION_BACKEND = getattr(settings, 'NOTIFICATION_BACKEND',
        'organizations.backends.defaults.NotificationBackend')

ORGS_EMAIL_LENGTH = model_field_attr(User, 'email', 'max_length')
Ejemplo n.º 6
0
 def get_username(self):
     """Returns an UUID based 'random' and unique username"""
     return unicode(uuid.uuid4())[:model_field_attr(self.user_model, 'username', 'max_length')]
Ejemplo n.º 7
0
 def test_present_field(self):
     self.assertTrue(model_field_attr(User, "username", "max_length"))
Ejemplo n.º 8
0
 def test_present_field(self):
     self.assertTrue(model_field_attr(User, 'username', 'max_length'))
Ejemplo n.º 9
0
 def test_present_field(self):
     self.assertTrue(model_field_attr(User, "username", "max_length"))
Ejemplo n.º 10
0
# following disclaimer in the documentation and/or other materials provided with
# the distribution
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from django.conf import settings
from django.contrib.auth.models import User

from organizations.utils import model_field_attr

ORGS_INVITATION_BACKEND = getattr(
    settings, "INVITATION_BACKEND",
    "organizations.backends.defaults.InvitationBackend")

ORGS_REGISTRATION_BACKEND = getattr(
    settings,
    "REGISTRATION_BACKEND",
    "organizations.backends.defaults.RegistrationBackend",
)

ORGS_EMAIL_LENGTH = model_field_attr(User, "email", "max_length")
Ejemplo n.º 11
0
 def get_username(self):
     """Returns a UUID based 'random' and unique username"""
     return str(uuid.uuid4())[: model_field_attr(self.user_model, "username", "max_length")]
Ejemplo n.º 12
0
# list of conditions and the following disclaimer.  Redistributions in binary
# form must reproduce the above copyright notice, this list of conditions and the
# following disclaimer in the documentation and/or other materials provided with
# the distribution
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from django.conf import settings
from django.contrib.auth.models import User

from organizations.utils import model_field_attr

ORGS_INVITATION_BACKEND = getattr(
    settings, 'INVITATION_BACKEND',
    'organizations.backends.defaults.InvitationBackend')

ORGS_REGISTRATION_BACKEND = getattr(
    settings, 'REGISTRATION_BACKEND',
    'organizations.backends.defaults.RegistrationBackend')

ORGS_EMAIL_LENGTH = model_field_attr(User, 'email', 'max_length')
Ejemplo n.º 13
0
# the distribution
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from django.conf import settings
from django.contrib.auth.models import User

from organizations.utils import model_field_attr


ORGS_INVITATION_BACKEND = getattr(
    settings, "INVITATION_BACKEND", "organizations.backends.defaults.InvitationBackend"
)

ORGS_REGISTRATION_BACKEND = getattr(
    settings,
    "REGISTRATION_BACKEND",
    "organizations.backends.defaults.RegistrationBackend",
)

ORGS_EMAIL_LENGTH = model_field_attr(User, "email", "max_length")