Projet

Général

Profil

0018-misc-fix-invalid-str-returned-pylint-error-56982.patch

Valentin Deniaud, 21 septembre 2021 17:09

Télécharger (5,09 ko)

Voir les différences:

Subject: [PATCH 18/59] misc: fix invalid-str-returned pylint error (#56982)

 src/authentic2/a2_rbac/models.py   | 2 +-
 src/authentic2/models.py           | 4 ++--
 src/authentic2/nonce/models.py     | 2 +-
 src/authentic2/saml/models.py      | 6 +++---
 src/authentic2_auth_oidc/models.py | 2 +-
 src/authentic2_idp_cas/models.py   | 4 ++--
 src/django_rbac/models.py          | 5 +++--
 7 files changed, 13 insertions(+), 12 deletions(-)
src/authentic2/a2_rbac/models.py
183 183
        }
184 184

  
185 185
    def __str__(self):
186
        return self.name
186
        return str(self.name)
187 187

  
188 188

  
189 189
OrganizationalUnit._meta.natural_key = [['uuid'], ['slug'], ['name']]
src/authentic2/models.py
294 294
        return '<%s %s>' % (self.__class__.__name__, repr(str(self)))
295 295

  
296 296
    def __str__(self):
297
        return self.label
297
        return str(self.label)
298 298

  
299 299
    class Meta:
300 300
        verbose_name = _('attribute definition')
......
408 408
        return [self.ou and self.ou.natural_key(), self.slug]
409 409

  
410 410
    def __str__(self):
411
        return self.name
411
        return str(self.name)
412 412

  
413 413
    def __repr__(self):
414 414
        return '<%s %r>' % (self.__class__.__name__, str(self))
src/authentic2/nonce/models.py
36 36
    objects = NonceManager()
37 37

  
38 38
    def __str__(self):
39
        return self.value
39
        return str(self.value)
src/authentic2/saml/models.py
291 291
        verbose_name_plural = _('service provider options policies')
292 292

  
293 293
    def __str__(self):
294
        return self.name
294
        return str(self.name)
295 295

  
296 296

  
297 297
class SAMLAttribute(models.Model):
......
587 587
        verbose_name_plural = _("SAML federations")
588 588

  
589 589
    def __str__(self):
590
        return self.name_id_content
590
        return str(self.name_id_content)
591 591

  
592 592

  
593 593
class LibertySession(models.Model):
......
650 650
    objects = a2_managers.ExpireManager()
651 651

  
652 652
    def __str__(self):
653
        return self.key
653
        return str(self.key)
654 654

  
655 655
    class Meta:
656 656
        verbose_name = _("key value association")
src/authentic2_auth_oidc/models.py
113 113
        return None
114 114

  
115 115
    def __str__(self):
116
        return self.name
116
        return str(self.name)
117 117

  
118 118
    def authorization_claims_parameter(self):
119 119
        idtoken_claims = {}
src/authentic2_idp_cas/models.py
73 73
        return list(wanted)
74 74

  
75 75
    def __str__(self):
76
        return self.name
76
        return str(self.name)
77 77

  
78 78
    class Meta:
79 79
        verbose_name = _('service')
......
131 131
    objects = managers.TicketManager()
132 132

  
133 133
    def __str__(self):
134
        return self.ticket_id
134
        return str(self.ticket_id)
135 135

  
136 136
    def valid(self):
137 137
        return self.validity and not self.expired() and self.session_exists()
src/django_rbac/models.py
5 5
from django.conf import settings
6 6
from django.db import models
7 7
from django.db.models.query import Prefetch, Q
8
from django.utils.translation import gettext
8 9
from django.utils.translation import ugettext_lazy as _
9 10

  
10 11
try:
......
36 37
    objects = managers.AbstractBaseManager()
37 38

  
38 39
    def __str__(self):
39
        return self.name
40
        return str(self.name)
40 41

  
41 42
    def __repr__(self):
42 43
        return f'<{self.__class__.__name__} {repr(self.slug)} {repr(self.name)}>'
......
163 164
        else:
164 165
            s = f'{self.operation} / {ct} / {self.target}'
165 166
        if self.ou:
166
            s += _(' (scope "{0}")').format(self.ou)
167
            s += gettext(' (scope "{0}")').format(self.ou)
167 168
        return s
168 169

  
169 170
    class Meta:
170
-