Models
hypha.apply.users.models
¶
UserQuerySet
¶
UserManager
¶
Bases: from_queryset(UserQuerySet)
create_user
¶
create_superuser
¶
Source code in hypha/apply/users/models.py
get_or_create_and_notify
¶
Create or get an account for applicant and send activation email to applicant.
Parameters:
-
defaults
(dict | None
, default:None
) –Dict containing user attributes for user creation. Defaults to dict().
-
site
–current site for sending activation email. Defaults to None.
Raises:
-
IntegrityError
–if multiple account exist with same email
Returns:
-
–
A tuple containing a user instance and a boolean that indicates
-
–
whether the user was created or not.
Source code in hypha/apply/users/models.py
User
¶
Bases: AbstractUser
email
class-attribute
instance-attribute
¶
full_name
class-attribute
instance-attribute
¶
slack
class-attribute
instance-attribute
¶
slack = CharField(verbose_name=gettext_lazy('Slack name'), blank=True, help_text=gettext_lazy('This is the name we should "@mention" when sending notifications'), max_length=50)
drupal_id
class-attribute
instance-attribute
¶
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
get_full_name
¶
get_short_name
¶
Gets the local-part (username) of the user's email
ie. hyphaiscool@hypha.app returns "hyphaiscool"
get_display_name
¶
get_role_names
¶
Source code in hypha/apply/users/models.py
roles
¶
is_apply_staff
¶
is_apply_staff_admin
¶
is_reviewer
¶
is_partner
¶
is_community_reviewer
¶
is_applicant
¶
is_approver
¶
is_finance
¶
is_org_faculty
¶
can_access_dashboard
¶
is_contracting
¶
is_contracting_approver
¶
get_absolute_url
¶
Used in the activities messages to generate URL for user instances.
Returns:
-
–
url pointing to the wagtail admin, as there are no public urls for user.
Source code in hypha/apply/users/models.py
AuthSettings
¶
Bases: BaseGenericSetting
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
consent_show
class-attribute
instance-attribute
¶
consent_text
class-attribute
instance-attribute
¶
extra_text
class-attribute
instance-attribute
¶
extra_text = RichTextField(gettext_lazy('Login extra text'), blank=True, help_text=gettext_lazy('Displayed along side login form'))
panels
class-attribute
instance-attribute
¶
panels = [MultiFieldPanel([FieldPanel('consent_show'), FieldPanel('consent_text'), FieldPanel('consent_help')], gettext_lazy('User consent on login & register forms')), MultiFieldPanel([FieldPanel('extra_text')], gettext_lazy('Login form customizations'))]
PendingSignup
¶
Bases: Model
This model tracks pending passwordless self-signups, and is used to generate a one-time use URLfor each signup.
The URL is sent to the user via email, and when they click on it, they are redirected to the registration page, where a new is created.
Once the user is created, the PendingSignup instance is deleted.
ConfirmAccessToken
¶
Bases: Model
Once the user is created, the PendingSignup instance is deleted.