예제 #1
0
파일: Profile.py 프로젝트: kradecki/psinque
    def addwww(self):

        userWebpage = UserWebpage(parent = self.userProfile,
                                  itemValue = self.getRequiredParameter('www'),
                                  privacyType = self.getRequiredParameter('privacy'),
                                  itemType = self.getRequiredParameter('type'))
        userWebpage.put()

        # Add permissions for this email in every outgoing group
        for persona in self.userProfile.personas:
            permitWebpage = PermitWebpage(parent = persona,
                                          userWebpage = userWebpage)
            permitWebpage.put()

        self._updateAllVCards()

        self.sendJsonOK({'key': str(userWebpage.key())})
예제 #2
0
def deleteProfile(userProfileKey):

    userProfile = UserProfile.get(userProfileKey)    
    
    for e in CardDAVLogin.all().ancestor(userProfile):
        e.delete()
    for e in IndividualPermit.all().ancestor(userProfile):
        e.delete()
    for e in Persona.all().ancestor(userProfile):
        e.delete()
    for e in Psinque.all().ancestor(userProfile):
        e.delete()
    for e in Contact.all().ancestor(userProfile):
        e.delete()
    for e in Group.all().ancestor(userProfile):
        e.delete()
    for e in UserAddress.all().ancestor(userProfile):
        e.delete()
    for e in UserEmail.all().ancestor(userProfile):
        e.delete()
    for e in UserIM.all().ancestor(userProfile):
        e.delete()
    for e in UserPhoneNumber.all().ancestor(userProfile):
        e.delete()
    for e in UserPhoto.all().ancestor(userProfile):
        e.image.delete()
        e.delete()
    for e in UserNickname.all().ancestor(userProfile):
        e.delete()
    for e in UserCompany.all().ancestor(userProfile):
        e.delete()
    for e in UserWebpage.all().ancestor(userProfile):
        e.delete()
    
    if not userProfile.userSettings is None:
        userProfile.userSettings.delete()
        
    userProfile.delete()
    logging.info("User profile deleted")