示例#1
0
    def save(self, *args, **kwargs):
        if not self.id:
            self.guid = str(uuid.uuid1())

        # match allow_anonymous_view with opposite of hide_in_search
        if self.hide_in_search:
            self.allow_anonymous_view = False
        else:
            self.allow_anonymous_view = get_setting(
                'module', 'users', 'allowanonymoususersearchuser')

        self.allow_user_view = get_setting('module', 'users',
                                           'allowusersearch')
        if get_setting('module', 'memberships',
                       'memberprotection') == 'private':
            self.allow_member_view = False
        else:
            self.allow_member_view = True

        super(Profile, self).save(*args, **kwargs)

        try:
            from tendenci.apps.campaign_monitor.utils import update_subscription
            if hasattr(self, 'old_email') and getattr(
                    self, 'old_email') != self.user.email:
                update_subscription(self, self.old_email)
                del self.old_email
        except ImportError:
            pass
示例#2
0
    def save(self, *args, **kwargs):
        if not self.id:
            self.guid = str(uuid.uuid1())

        # match allow_anonymous_view with opposite of hide_in_search
        if self.hide_in_search:
            self.allow_anonymous_view = False
        else:
            self.allow_anonymous_view = get_setting('module', 'users', 'allowanonymoususersearchuser')
            
        self.allow_user_view =  get_setting('module', 'users', 'allowusersearch')
        if get_setting('module', 'memberships', 'memberprotection') == 'private':
            self.allow_member_view = False
        else:
            self.allow_member_view = True
        

        super(Profile, self).save(*args, **kwargs)

        try:
            from tendenci.apps.campaign_monitor.utils import update_subscription
            if hasattr(self, 'old_email') and getattr(self, 'old_email') != self.user.email:
                update_subscription(self, self.old_email)
                del self.old_email
        except ImportError:
            pass
示例#3
0
    def save(self, *args, **kwargs):
        if not self.id:
            self.guid = str(uuid.uuid1())

        # match allow_anonymous_view with opposite of hide_in_search
        if self.hide_in_search:
            self.allow_anonymous_view = False
        else:
            self.allow_anonymous_view = True

        super(Profile, self).save(*args, **kwargs)

        try:
            from tendenci.apps.campaign_monitor.utils import update_subscription
            if hasattr(self, 'old_email') and getattr(self, 'old_email') != self.user.email:
                update_subscription(self, self.old_email)
                del self.old_email
        except ImportError:
            pass
示例#4
0
文件: models.py 项目: morad7/tendenci
    def save(self, *args, **kwargs):
        if not self.id:
            self.guid = str(uuid.uuid1())

        # match allow_anonymous_view with opposite of hide_in_search
        if self.hide_in_search:
            self.allow_anonymous_view = False
        else:
            self.allow_anonymous_view = True

        super(Profile, self).save(*args, **kwargs)

        try:
            from tendenci.apps.campaign_monitor.utils import update_subscription
            if hasattr(self, 'old_email') and getattr(
                    self, 'old_email') != self.user.email:
                update_subscription(self, self.old_email)
                del self.old_email
        except ImportError:
            pass