コード例 #1
0
def addRecruiter(email, name, organization):

    print('creating Recruiter ' + email + ' ' + name + ' ' + organization)

    account = models.Account()
    account.username = email
    account.password = dataplus.hash(dataplus.getUniqueId())
    account.account_type = 'FR'
    account.account_state = 'I'
    
    account.email_verified = True
        
    account.save()

    rec = models.Recruiter()
    rec.account = account
    rec.key = dataplus.getUniqueId()

    rec.email = email
    rec.name = name
    rec.organization = organization
    rec.telephone = ''

    #default values
    rec.verified = True #only through invites
    rec.verified_on = datetime.datetime(1981, 1, 9) #default date min value ;)
    rec.results_last_sent_on = datetime.datetime(1981, 1, 9)   #Jes' bday -- default min date

    rec.save()
    
    models.RecruiterData(recruiter=rec).save()
    
    models.Token.getNew(email, type='RecPropaganda')

    return rec
コード例 #2
0
ファイル: recruiters_signup.py プロジェクト: jeswin/JobHunt
def addRecruiter(email, password, name, organization, telephone, token, through_invite):
    account = models.Account()
    account.username = email
    account.password = dataplus.hash(password)
    account.account_type = 'FR'
    account.account_state = 'A'
    
    account.email_verified = False
    if through_invite:
        account.email_verified = True
        
    account.save()

    rec = models.Recruiter()
    rec.account = account
    rec.key = dataplus.getUniqueId()

    rec.email = email
    rec.name = name
    rec.organization = organization
    rec.telephone = telephone

    #default values
    rec.verified = True #only through invites
    rec.verified_on = datetime.datetime(1981, 1, 9) #default date min value ;)
    rec.results_last_sent_on = datetime.datetime(1981, 1, 9)   #Jes' bday -- default min date

    rec.save()
    
    models.RecruiterData(recruiter=rec).save()
    
    #delete the token
    token.delete()

    return rec
コード例 #3
0
def addRecruiter(email, name, organization):

    print("creating Recruiter " + email + " " + name + " " + organization)

    account = models.Account()
    account.username = email
    account.password = dataplus.hash(dataplus.getUniqueId())
    account.account_type = "FR"
    account.account_state = "I"

    account.email_verified = True

    account.save()

    rec = models.Recruiter()
    rec.account = account
    rec.key = dataplus.getUniqueId()

    rec.email = email
    rec.name = name
    rec.organization = organization
    rec.telephone = ""

    # default values
    rec.verified = True  # only through invites
    rec.verified_on = datetime.datetime(1981, 1, 9)  # default date min value ;)
    rec.results_last_sent_on = datetime.datetime(1981, 1, 9)  # Jes' bday -- default min date

    rec.save()

    models.RecruiterData(recruiter=rec).save()

    models.Token.getNew(email, type="RecPropaganda")

    return rec
コード例 #4
0
    def create(cls, username, password, account_type):
        acct = Account(username=username,
                       password=dataplus.hash(password),
                       account_type=account_type,
                       account_state='A',
                       email_verified=False)
        acct.save()

        return acct
コード例 #5
0
ファイル: account.py プロジェクト: jeswin/JobHunt
    def create(cls, username, password, account_type):
        acct = Account(
            username=username,
            password=dataplus.hash(password),
            account_type=account_type,
            account_state="A",
            email_verified=False,
        )
        acct.save()

        return acct
コード例 #6
0
ファイル: auth.py プロジェクト: panyang/JobHunt
def login(request, username, password, success_url=''):
    account = dataplus.returnIfExists(
        models.Account.objects.filter(username=username,
                                      password=dataplus.hash(password)))
    redirect_url = '/login.htm?flashId=login_failed'
    if account and account.account_type in ['FR', 'PU']:
        request.session['username'] = account.username
        request.session['account_type'] = account.account_type
        request.session['account_state'] = account.account_state

        if success_url:
            redirect_url = success_url
        elif request.GET.get('redir', ''):
            redirect_url = request.GET.get('redir', '').replace('__amp__', '&')
        else:
            redirect_url = {
                'FR': '/recruiters/',
                'PU': '/dashboard.htm'
            }[account.account_type]

    return HttpResponseRedirect(redirect_url)
コード例 #7
0
def addRecruiter(email, password, name, organization, telephone, token,
                 through_invite):
    account = models.Account()
    account.username = email
    account.password = dataplus.hash(password)
    account.account_type = 'FR'
    account.account_state = 'A'

    account.email_verified = False
    if through_invite:
        account.email_verified = True

    account.save()

    rec = models.Recruiter()
    rec.account = account
    rec.key = dataplus.getUniqueId()

    rec.email = email
    rec.name = name
    rec.organization = organization
    rec.telephone = telephone

    #default values
    rec.verified = True  #only through invites
    rec.verified_on = datetime.datetime(1981, 1, 9)  #default date min value ;)
    rec.results_last_sent_on = datetime.datetime(
        1981, 1, 9)  #Jes' bday -- default min date

    rec.save()

    models.RecruiterData(recruiter=rec).save()

    #delete the token
    token.delete()

    return rec
コード例 #8
0
ファイル: account.py プロジェクト: jeswin/JobHunt
 def setPassword(self, new_password):
     self.password = dataplus.hash(new_password)
     self.save()
コード例 #9
0
 def setPassword(self, new_password):
     self.password = dataplus.hash(new_password)
     self.save()
コード例 #10
0
ファイル: auth.py プロジェクト: jeswin/JobHunt
def login(request, username, password, success_url=''):
    account = dataplus.returnIfExists(models.Account.objects.filter(username=username, password=dataplus.hash(password)))
    redirect_url = '/login.htm?flashId=login_failed'
    if account and account.account_type in ['FR','PU']:
        request.session['username'] = account.username
        request.session['account_type'] = account.account_type
        request.session['account_state'] = account.account_state
        
        if success_url:
            redirect_url = success_url
        elif request.GET.get('redir',''):
            redirect_url = request.GET.get('redir','').replace('__amp__', '&')
        else:
            redirect_url = {'FR': '/recruiters/',
                            'PU':'/dashboard.htm'}[account.account_type]
                        
    return HttpResponseRedirect(redirect_url)