Jump to >

reviewboard.accounts.models

class ReviewRequestVisit(*args, **kwargs)[source]

A recording of the last time a review request was visited by a user.

Users have one ReviewRequestVisit entry in the database per review request they’ve visited. This is used to keep track of any updates to review requests they’ve already seen, so that we can intelligently inform them that new discussions have taken place.

class Profile(*args, **kwargs)[source]

User profile which contains some basic configurable settings.

property should_use_rich_text[source]

Get whether rich text should be used by default for this user.

If the user has chosen whether or not to use rich text explicitly, then that choice will be respected. Otherwise, the system default is used.

property should_enable_desktop_notifications[source]

Return whether desktop notifications should be used for this user.

If the user has chosen whether or not to use desktop notifications explicitly, then that choice will be respected. Otherwise, we enable desktop notifications by default.

Returns

If the user has set whether they wish to recieve desktop notifications, then use their preference. Otherwise, we return True.

Return type

bool

star_review_request(review_request)[source]

Mark a review request as starred.

This will mark a review request as starred for this user and immediately save to the database.

unstar_review_request(review_request)[source]

Mark a review request as unstarred.

This will mark a review request as starred for this user and immediately save to the database.

star_review_group(review_group)[source]

Mark a review group as starred.

This will mark a review group as starred for this user and immediately save to the database.

unstar_review_group(review_group)[source]

Mark a review group as unstarred.

This will mark a review group as starred for this user and immediately save to the database.

property avatar_service[source]

The avatar service the user has selected.

Returns

The avatar service.

Return type

djblets.avatars.services.base.AvatarService

get_display_name(viewing_user)[source]

Return the name to display to the given user.

If any of the following is True and the user this profile belongs to has a full name set, the display name will be the the user’s full name:

  • The viewing user is authenticated and this profile is public.

  • The viewing user is the user this profile belongs to.

  • The viewing user is an administrator.

  • The viewing user is a LocalSite administrator on any LocalSite for which the user whose this profile belongs to is a user.

Otherwise the display name will be the user’s username.

Parameters

viewing_user (django.contrib.auth.models.User) – The user who is viewing the profile.

Returns

The name to display.

Return type

unicode

save(*args, **kwargs)[source]

Save the profile to the database.

The profile will only be saved if the user is not affected by read-only mode.

Parameters
  • *args (tuple) – Positional arguments to pass through to the superclass.

  • **kwargs (dict) – Keyword arguments to pass through to the superclass.

class LocalSiteProfile(*args, **kwargs)[source]

User profile information specific to a LocalSite.

class Trophy(*args, **kwargs)[source]

A trophy represents an achievement given to the user.

It is associated with a ReviewRequest and a User and can be associated with a LocalSite.

trophy_type[source]

The TrophyType instance for this trophy.

get_display_text()[source]

Get the display text for this trophy.