예제 #1
0
 def save(self, commit=True):
     profile = super(ProfileUpdateForm, self).save(commit=False)
     profile.previous_account_status = self.initial_account_status
     if self.initial_account_status != profile.account_status:
         update_openldap_user(profile)
     if commit:
         profile.save()
     return profile
예제 #2
0
파일: admin.py 프로젝트: rantahar/cogs3
 def activate_users(self, request, queryset):
     rows_updated = 0
     for user in queryset:
         user.profile.account_status = Profile.APPROVED
         user.save()
         rows_updated += 1
         update_openldap_user(user.profile)
     message = self._account_action_message(rows_updated)
     self.message_user(
         request, '{message} successfully submitted for activation.'.format(
             message=message))
예제 #3
0
파일: forms.py 프로젝트: markgdawson/cogs3
    def save(self, commit=True):
        profile = super(ProfileUpdateForm, self).save(commit=False)

        # Ensure any updates to the account status are propagated to LDAP.
        profile.previous_account_status = self.initial_account_status
        if self.initial_account_status != profile.account_status:
            update_openldap_user(profile)

        if commit:
            profile.save()
        return profile
예제 #4
0
 def activate(self):
     self.status = self.APPROVED
     self.save()
     update_openldap_user(self)