Projet

Général

Profil

« Précédent | Suivant » 

Révision 4c755abe

Ajouté par Jérôme Schneider il y a plus de 9 ans

backends: add last_connection_date and creation_date to update_or_create

Closes #5542

Voir les différences:

mandaye/backends/sql.py
71 71
        return False
72 72

  
73 73
    @staticmethod
74
    def update_or_create(sp_name, sp_login, sp_post_values, idp_unique_id, idp_name='default'):
74
    def update_or_create(sp_name, sp_login, sp_post_values, idp_unique_id,
75
            idp_name='default', creation_date=None, last_connection_date=None):
75 76
        """ update or create an associtaion which match the following values
76 77
        return the association id
77 78
        """
......
105 106
                        idp_id=idp_name
106 107
                        )
107 108
                storage_conn.add(idp_user)
109
            creation_date = creation_date or datetime.utcnow()
110
            last_connection_date = last_connection_date or datetime.utcnow()
108 111
            sp_user = SPUser(
109 112
                    login=sp_login,
110 113
                    post_values=sp_post_values,
111 114
                    idp_user=idp_user,
112
                    service_provider=service_provider
115
                    service_provider=service_provider,
116
                    creation_date=creation_date,
117
                    last_connection=last_connection_date
113 118
                    )
114 119
            storage_conn.add(sp_user)
115 120
            try:

Formats disponibles : Unified diff