Skip to content

Commit

Permalink
[change] Added configuration settings for dj-rest-auth >= 3.0
Browse files Browse the repository at this point in the history
The development version of openwisp-radius increased the dependecy
version of dj-rest-auth.

The dj-rest-auth >= changed configuration settings. This patch
adds those settings without removing the old settings. This is done
to maintain backward compatabilty with older version of dj-rest-auth.

Related to openwisp/openwisp-radius@265f88a
  • Loading branch information
pandafy committed Jul 7, 2023
1 parent 051e063 commit 11ab64c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templates/openwisp2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,24 @@

{% if openwisp2_radius %}
OPENWISP_RADIUS_FREERADIUS_ALLOWED_HOSTS = {{ openwisp2_radius_allowed_hosts }}
REST_AUTH = {
'SESSION_LOGIN': False,
'PASSWORD_RESET_SERIALIZER': 'openwisp_radius.api.serializers.PasswordResetSerializer',
'REGISTER_SERIALIZER': 'openwisp_radius.api.serializers.RegisterSerializer',
}

# dj-rest-auth 3.0 changed the configuration settings.
# The below settings are kept for backward compatability with dj-rest-auth < 3.0
#
# Backward compatible settings begins
REST_AUTH_SERIALIZERS = {
'PASSWORD_RESET_SERIALIZER': 'openwisp_radius.api.serializers.PasswordResetSerializer',
}
REST_AUTH_REGISTER_SERIALIZERS = {
'REGISTER_SERIALIZER': 'openwisp_radius.api.serializers.RegisterSerializer',
}
# Backward compatible settings ends

# SMS settings
OPENWISP_RADIUS_SMS_TOKEN_MAX_IP_DAILY = {{ openwisp2_radius_sms_token_max_ip_daily }}
SENDSMS_BACKEND = '{{ openwisp2_radius_sms_backend }}'
Expand Down

0 comments on commit 11ab64c

Please sign in to comment.