Skip to content

Commit 2d68f18

Browse files
authored
Invitations: fix model name (object_type) (#9837)
ContentType.name is the human-readable name, this is taken from the label, which in some models is a translatable string (https://github.com/readthedocs/readthedocs.org/blob/a00eff14643eeb1f114f6bcc6d71510e5c3d51fd/readthedocs/projects/models.py#L468-L468). What we actually want is ContentType.model https://docs.djangoproject.com/en/4.1/ref/contrib/contenttypes/#django.contrib.contenttypes.models.ContentType, that is the plain model name in lowercase.
1 parent a00eff1 commit 2d68f18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readthedocs/invitations/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def can_revoke_invitation(self, user):
207207

208208
@property
209209
def object_type(self):
210-
return self.content_type.name
210+
return self.content_type.model
211211

212212
@property
213213
def object_name(self):

0 commit comments

Comments
 (0)