Skip to content

Commit

Permalink
[req-changes] Updated model field definition and formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Aug 7, 2024
1 parent d1c5b99 commit a4e3370
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
43 changes: 0 additions & 43 deletions openwisp_radius/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,17 +1079,11 @@ class AbstractOrganizationRadiusSettings(UUIDModel):
)
token = KeyField(max_length=32)
sms_verification = FallbackBooleanChoiceField(
null=True,
blank=True,
default=None,
help_text=_SMS_VERIFICATION_HELP_TEXT,
fallback=app_settings.SMS_VERIFICATION_ENABLED,
verbose_name=_('SMS verification'),
)
needs_identity_verification = FallbackBooleanChoiceField(
null=True,
blank=True,
default=None,
help_text=_IDENTITY_VERIFICATION_ENABLED_HELP_TEXT,
fallback=app_settings.NEEDS_IDENTITY_VERIFICATION,
)
Expand All @@ -1105,8 +1099,6 @@ class AbstractOrganizationRadiusSettings(UUIDModel):
sms_message = FallbackTextField(
_('SMS Message'),
max_length=160,
blank=True,
null=True,
help_text=_(
'SMS message template used for sending verification code.'
' Must contain "{code}" placeholder for OTP value.'
Expand All @@ -1115,9 +1107,6 @@ class AbstractOrganizationRadiusSettings(UUIDModel):
)
sms_cooldown = FallbackPositiveIntegerField(
_('SMS Cooldown'),
blank=True,
null=True,
default=None,
help_text=_(
'Time period a user will have to wait before requesting'
' another SMS token (in seconds).'
Expand All @@ -1134,90 +1123,61 @@ class AbstractOrganizationRadiusSettings(UUIDModel):
verbose_name=_('SMS meta data'),
)
freeradius_allowed_hosts = FallbackTextField(
null=True,
blank=True,
help_text=_GET_IP_LIST_HELP_TEXT,
default=None,
fallback=','.join(app_settings.FREERADIUS_ALLOWED_HOSTS),
)
coa_enabled = FallbackBooleanChoiceField(
null=True,
blank=True,
default=None,
help_text=_COA_ENABLED_HELP_TEXT,
fallback=app_settings.COA_ENABLED,
verbose_name=_('CoA Enabled'),
)
allowed_mobile_prefixes = FallbackTextField(
null=True,
blank=True,
help_text=_GET_MOBILE_PREFIX_HELP_TEXT,
default=None,
fallback=','.join(app_settings.ALLOWED_MOBILE_PREFIXES),
)
first_name = FallbackCharChoiceField(
verbose_name=_('first name'),
help_text=_GET_OPTIONAL_FIELDS_HELP_TEXT,
max_length=12,
null=True,
blank=True,
choices=OPTIONAL_FIELD_CHOICES,
fallback=OPTIONAL_SETTINGS.get('first_name', None),
)
last_name = FallbackCharChoiceField(
verbose_name=_('last name'),
help_text=_GET_OPTIONAL_FIELDS_HELP_TEXT,
max_length=12,
null=True,
blank=True,
choices=OPTIONAL_FIELD_CHOICES,
fallback=OPTIONAL_SETTINGS.get('last_name', None),
)
location = FallbackCharChoiceField(
verbose_name=_('location'),
help_text=_GET_OPTIONAL_FIELDS_HELP_TEXT,
max_length=12,
null=True,
blank=True,
choices=OPTIONAL_FIELD_CHOICES,
fallback=OPTIONAL_SETTINGS.get('location', None),
)
birth_date = FallbackCharChoiceField(
verbose_name=_('birth date'),
help_text=_GET_OPTIONAL_FIELDS_HELP_TEXT,
max_length=12,
null=True,
blank=True,
choices=OPTIONAL_FIELD_CHOICES,
fallback=OPTIONAL_SETTINGS.get('birth_date', None),
)
registration_enabled = FallbackBooleanChoiceField(
null=True,
blank=True,
default=None,
help_text=_REGISTRATION_ENABLED_HELP_TEXT,
fallback=app_settings.REGISTRATION_API_ENABLED,
)
saml_registration_enabled = FallbackBooleanChoiceField(
null=True,
blank=True,
default=None,
help_text=_SAML_REGISTRATION_ENABLED_HELP_TEXT,
verbose_name=_('SAML registration enabled'),
fallback=app_settings.SAML_REGISTRATION_ENABLED,
)
mac_addr_roaming_enabled = FallbackBooleanChoiceField(
null=True,
blank=True,
default=None,
help_text=_MAC_ADDR_ROAMING_ENABLED_HELP_TEXT,
verbose_name=_('MAC address roaming enabled'),
fallback=app_settings.MAC_ADDR_ROAMING_ENABLED,
)
social_registration_enabled = FallbackBooleanChoiceField(
null=True,
blank=True,
default=None,
help_text=_SOCIAL_REGISTRATION_ENABLED_HELP_TEXT,
fallback=app_settings.SOCIAL_REGISTRATION_ENABLED,
)
Expand All @@ -1235,11 +1195,8 @@ class AbstractOrganizationRadiusSettings(UUIDModel):
)
password_reset_url = FallbackCharField(
verbose_name=_('Password reset URL'),
null=True,
blank=True,
max_length=200,
help_text=_PASSWORD_RESET_URL_HELP_TEXT,
default=None,
fallback=DEFAULT_PASSWORD_RESET_URL,
validators=[password_reset_url_validator],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class Migration(migrations.Migration):

dependencies = [
("openwisp_radius", "0036_organizationradiussettings_mac_addr_roaming_enabled"),
]
Expand Down
1 change: 0 additions & 1 deletion openwisp_radius/migrations/0038_clean_fallbackfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def clean_fallback_fields(apps, schema_editor):


class Migration(migrations.Migration):

dependencies = [
(
'openwisp_radius',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

dependencies = [
(
"sample_radius",
Expand Down

0 comments on commit a4e3370

Please sign in to comment.