Skip to content

Commit

Permalink
Merge pull request #628 from CTPUG/dynamic-settings
Browse files Browse the repository at this point in the history
Locate the WAFER_USER_IS_REGISTERED function at runtime
  • Loading branch information
stefanor committed May 3, 2022
2 parents 0a49eb9 + b467710 commit ec2a4fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wafer/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# Specification taken from https://support.twitter.com/articles/101299
TwitterValidator = RegexValidator('^[A-Za-z0-9_]{1,15}$',
'Incorrectly formatted twitter handle')
is_registered = import_string(settings.WAFER_USER_IS_REGISTERED)


class UserProfile(models.Model):
Expand Down Expand Up @@ -95,6 +94,7 @@ def display_name(self):
return self.user.get_full_name() or self.user.username

def is_registered(self):
is_registered = import_string(settings.WAFER_USER_IS_REGISTERED)
return is_registered(self.user)

is_registered.boolean = True
Expand Down

0 comments on commit ec2a4fc

Please sign in to comment.