Exemplo n.º 1
0
    def add_client(self, username, **tokens):
        if self.exists(username, **tokens):
            return 'Client %s does already exist' % username

        query = "insert into client (uid, password) values ('%s', '%s')"
        id = self.sql_add(query % (Q(username), Q(tokens.get('password', ''))))
        if not id:
            return 'A problem occured when adding client %s' % username
        client = ClientInfo(username, **tokens)
        client.save()
        return 'Client %s added' % username
Exemplo n.º 2
0
    def add_client(self, username, **tokens):
        if self.exists(username, **tokens):
            return 'Client %s does already exist' % username

        query = "insert into client (uid, password) values ('%s', '%s')"
        id = self.sql_add(query % (Q(username), Q(tokens.get('password', ''))))
        if not id:
            return 'A problem occured when adding client %s' % username
        client = ClientInfo(username, **tokens)
        client.save()
        return 'Client %s added' % username
Exemplo n.º 3
0
 def add_client(self, username, **tokens):
     if self.exists(username):
         return 'Client %s does already exist' % username
     client = ClientInfo(username, **tokens)
     client.save()
     return 'Client %s added' % username
Exemplo n.º 4
0
 def add_client(self, username, **tokens):
     if self.exists(username):
         return 'Client %s does already exist' % username
     client = ClientInfo(username, **tokens)
     client.save()
     return 'Client %s added' % username