We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Cannot unset country field
**Environment**:

  - CTFd Version/Commit: tag 2.0.4
  - Operating System: Ubuntu 16.04
  - Web Browser and Version: Chrome latest

**What happened?**
I changed my country to "Blank" (`<option></option>`) in settings, hit update, it said success, but refresh showed old country.

**What did you expect to happen?**
My country to be blank upon reload.

**How to reproduce your issue**
Set your country to anything (except blank). Try to change back to blank.

**Any associated stack traces or error logs**
N/A


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `CTFd/schemas/users.py`
Content:
```
1 from flask import session
2 from sqlalchemy.sql.expression import union_all
3 from marshmallow import fields, post_load
4 from marshmallow import validate, ValidationError, pre_load
5 from marshmallow.decorators import validates_schema
6 from marshmallow_sqlalchemy import field_for
7 from CTFd.models import ma, Users
8 from CTFd.utils import get_config
9 from CTFd.utils.validators import unique_email, validate_country_code
10 from CTFd.utils.user import is_admin, get_current_user
11 from CTFd.utils.countries import lookup_country_code
12 from CTFd.utils.crypto import verify_password, hash_password
13 from CTFd.utils.email import check_email_is_whitelisted
14 
15 
16 class UserSchema(ma.ModelSchema):
17     class Meta:
18         model = Users
19         include_fk = True
20         dump_only = ('id', 'oauth_id', 'created')
21         load_only = ('password',)
22 
23     name = field_for(
24         Users,
25         'name',
26         required=True,
27         validate=[
28             validate.Length(min=1, max=128, error='User names must not be empty')
29         ]
30     )
31     email = field_for(
32         Users,
33         'email',
34         validate=[
35             validate.Email('Emails must be a properly formatted email address'),
36             validate.Length(min=1, max=128, error='Emails must not be empty'),
37         ]
38     )
39     website = field_for(
40         Users,
41         'website',
42         validate=validate.URL(
43             error='Websites must be a proper URL starting with http or https',
44             schemes={'http', 'https'}
45         )
46     )
47     country = field_for(
48         Users,
49         'country',
50         validate=[
51             validate_country_code
52         ]
53     )
54     password = field_for(
55         Users,
56         'password',
57         validate=[
58             validate.Length(min=1, error='Passwords must not be empty'),
59         ]
60     )
61 
62     @pre_load
63     def validate_name(self, data):
64         name = data.get('name')
65         if name is None:
66             return
67 
68         existing_user = Users.query.filter_by(name=name).first()
69         if is_admin():
70             user_id = data.get('id')
71             if user_id:
72                 if existing_user and existing_user.id != user_id:
73                     raise ValidationError('User name has already been taken', field_names=['name'])
74             else:
75                 if existing_user:
76                     raise ValidationError('User name has already been taken', field_names=['name'])
77         else:
78             current_user = get_current_user()
79             if name == current_user.name:
80                 return data
81             else:
82                 name_changes = get_config('name_changes', default=True)
83                 if bool(name_changes) is False:
84                     raise ValidationError('Name changes are disabled', field_names=['name'])
85                 if existing_user:
86                     raise ValidationError('User name has already been taken', field_names=['name'])
87 
88     @pre_load
89     def validate_email(self, data):
90         email = data.get('email')
91         if email is None:
92             return
93 
94         existing_user = Users.query.filter_by(email=email).first()
95 
96         if is_admin():
97             user_id = data.get('id')
98             if user_id:
99                 if existing_user and existing_user.id != user_id:
100                     raise ValidationError('Email address has already been used', field_names=['email'])
101             else:
102                 if existing_user:
103                     raise ValidationError('Email address has already been used', field_names=['email'])
104         else:
105             current_user = get_current_user()
106             if email == current_user.email:
107                 return data
108             else:
109                 if existing_user:
110                     raise ValidationError('Email address has already been used', field_names=['email'])
111                 if check_email_is_whitelisted(email) is False:
112                     raise ValidationError(
113                         "Only email addresses under {domains} may register".format(
114                             domains=get_config('domain_whitelist')
115                         ),
116                         field_names=['email']
117                     )
118                 if get_config('verify_emails'):
119                     current_user.verified = False
120 
121     @pre_load
122     def validate_password_confirmation(self, data):
123         password = data.get('password')
124         confirm = data.get('confirm')
125         target_user = get_current_user()
126         user_id = data.get('id')
127 
128         if is_admin():
129             pass
130         else:
131             if password and (confirm is None):
132                 raise ValidationError('Please confirm your current password', field_names=['confirm'])
133 
134             if password and confirm:
135                 test = verify_password(plaintext=confirm, ciphertext=target_user.password)
136                 if test is True:
137                     return data
138                 else:
139                     raise ValidationError('Your previous password is incorrect', field_names=['confirm'])
140 
141     views = {
142         'user': [
143             'website',
144             'name',
145             'country',
146             'affiliation',
147             'bracket',
148             'id',
149             'oauth_id',
150         ],
151         'self': [
152             'website',
153             'name',
154             'email',
155             'country',
156             'affiliation',
157             'bracket',
158             'id',
159             'oauth_id',
160             'password'
161         ],
162         'admin': [
163             'website',
164             'name',
165             'created',
166             'country',
167             'banned',
168             'email',
169             'affiliation',
170             'secret',
171             'bracket',
172             'hidden',
173             'id',
174             'oauth_id',
175             'password',
176             'type',
177             'verified'
178         ]
179     }
180 
181     def __init__(self, view=None, *args, **kwargs):
182         if view:
183             if type(view) == str:
184                 kwargs['only'] = self.views[view]
185             elif type(view) == list:
186                 kwargs['only'] = view
187 
188         super(UserSchema, self).__init__(*args, **kwargs)
189
```

Path: `CTFd/utils/validators/__init__.py`
Content:
```
1 from flask import session
2 from CTFd.utils.user import is_admin, get_current_team, get_current_user
3 from CTFd.models import Teams, Users
4 from CTFd.utils.countries import lookup_country_code
5 from six.moves.urllib.parse import urlparse, urljoin, quote, unquote
6 from flask import request
7 from marshmallow import ValidationError
8 import re
9 
10 
11 def is_safe_url(target):
12     ref_url = urlparse(request.host_url)
13     test_url = urlparse(urljoin(request.host_url, target))
14     return test_url.scheme in ('http', 'https') and ref_url.netloc == test_url.netloc
15 
16 
17 def validate_url(url):
18     return urlparse(url).scheme.startswith('http')
19 
20 
21 def validate_email(email):
22     return bool(re.match(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", email))
23 
24 
25 def unique_email(email, model=Users):
26     obj = model.query.filter_by(email=email).first()
27     if is_admin():
28         if obj:
29             raise ValidationError('Email address has already been used')
30     if obj and obj.id != get_current_user().id:
31         raise ValidationError('Email address has already been used')
32 
33 
34 def validate_country_code(country_code):
35     if lookup_country_code(country_code) is None:
36         raise ValidationError('Invalid Country')
37
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/CTFd/schemas/users.py b/CTFd/schemas/users.py
--- a/CTFd/schemas/users.py
+++ b/CTFd/schemas/users.py
@@ -39,10 +39,13 @@
     website = field_for(
         Users,
         'website',
-        validate=validate.URL(
-            error='Websites must be a proper URL starting with http or https',
-            schemes={'http', 'https'}
-        )
+        validate=[
+            # This is a dirty hack to let website accept empty strings so you can remove your website
+            lambda website: validate.URL(
+                error='Websites must be a proper URL starting with http or https',
+                schemes={'http', 'https'}
+            )(website) if website else True
+        ]
     )
     country = field_for(
         Users,
@@ -54,9 +57,6 @@
     password = field_for(
         Users,
         'password',
-        validate=[
-            validate.Length(min=1, error='Passwords must not be empty'),
-        ]
     )
 
     @pre_load
@@ -123,12 +123,11 @@
         password = data.get('password')
         confirm = data.get('confirm')
         target_user = get_current_user()
-        user_id = data.get('id')
 
         if is_admin():
             pass
         else:
-            if password and (confirm is None):
+            if password and (bool(confirm) is False):
                 raise ValidationError('Please confirm your current password', field_names=['confirm'])
 
             if password and confirm:
@@ -137,6 +136,9 @@
                     return data
                 else:
                     raise ValidationError('Your previous password is incorrect', field_names=['confirm'])
+            else:
+                data.pop('password', None)
+                data.pop('confirm', None)
 
     views = {
         'user': [
diff --git a/CTFd/utils/validators/__init__.py b/CTFd/utils/validators/__init__.py
--- a/CTFd/utils/validators/__init__.py
+++ b/CTFd/utils/validators/__init__.py
@@ -32,5 +32,7 @@
 
 
 def validate_country_code(country_code):
+    if country_code.strip() == "":
+        return
     if lookup_country_code(country_code) is None:
         raise ValidationError('Invalid Country')

{"golden_diff": "diff --git a/CTFd/schemas/users.py b/CTFd/schemas/users.py\n--- a/CTFd/schemas/users.py\n+++ b/CTFd/schemas/users.py\n@@ -39,10 +39,13 @@\n     website = field_for(\n         Users,\n         'website',\n-        validate=validate.URL(\n-            error='Websites must be a proper URL starting with http or https',\n-            schemes={'http', 'https'}\n-        )\n+        validate=[\n+            # This is a dirty hack to let website accept empty strings so you can remove your website\n+            lambda website: validate.URL(\n+                error='Websites must be a proper URL starting with http or https',\n+                schemes={'http', 'https'}\n+            )(website) if website else True\n+        ]\n     )\n     country = field_for(\n         Users,\n@@ -54,9 +57,6 @@\n     password = field_for(\n         Users,\n         'password',\n-        validate=[\n-            validate.Length(min=1, error='Passwords must not be empty'),\n-        ]\n     )\n \n     @pre_load\n@@ -123,12 +123,11 @@\n         password = data.get('password')\n         confirm = data.get('confirm')\n         target_user = get_current_user()\n-        user_id = data.get('id')\n \n         if is_admin():\n             pass\n         else:\n-            if password and (confirm is None):\n+            if password and (bool(confirm) is False):\n                 raise ValidationError('Please confirm your current password', field_names=['confirm'])\n \n             if password and confirm:\n@@ -137,6 +136,9 @@\n                     return data\n                 else:\n                     raise ValidationError('Your previous password is incorrect', field_names=['confirm'])\n+            else:\n+                data.pop('password', None)\n+                data.pop('confirm', None)\n \n     views = {\n         'user': [\ndiff --git a/CTFd/utils/validators/__init__.py b/CTFd/utils/validators/__init__.py\n--- a/CTFd/utils/validators/__init__.py\n+++ b/CTFd/utils/validators/__init__.py\n@@ -32,5 +32,7 @@\n \n \n def validate_country_code(country_code):\n+    if country_code.strip() == \"\":\n+        return\n     if lookup_country_code(country_code) is None:\n         raise ValidationError('Invalid Country')\n", "issue": "Cannot unset country field\n**Environment**:\r\n\r\n  - CTFd Version/Commit: tag 2.0.4\r\n  - Operating System: Ubuntu 16.04\r\n  - Web Browser and Version: Chrome latest\r\n\r\n**What happened?**\r\nI changed my country to \"Blank\" (`<option></option>`) in settings, hit update, it said success, but refresh showed old country.\r\n\r\n**What did you expect to happen?**\r\nMy country to be blank upon reload.\r\n\r\n**How to reproduce your issue**\r\nSet your country to anything (except blank). Try to change back to blank.\r\n\r\n**Any associated stack traces or error logs**\r\nN/A\r\n\n", "before_files": [{"content": "from flask import session\nfrom sqlalchemy.sql.expression import union_all\nfrom marshmallow import fields, post_load\nfrom marshmallow import validate, ValidationError, pre_load\nfrom marshmallow.decorators import validates_schema\nfrom marshmallow_sqlalchemy import field_for\nfrom CTFd.models import ma, Users\nfrom CTFd.utils import get_config\nfrom CTFd.utils.validators import unique_email, validate_country_code\nfrom CTFd.utils.user import is_admin, get_current_user\nfrom CTFd.utils.countries import lookup_country_code\nfrom CTFd.utils.crypto import verify_password, hash_password\nfrom CTFd.utils.email import check_email_is_whitelisted\n\n\nclass UserSchema(ma.ModelSchema):\n    class Meta:\n        model = Users\n        include_fk = True\n        dump_only = ('id', 'oauth_id', 'created')\n        load_only = ('password',)\n\n    name = field_for(\n        Users,\n        'name',\n        required=True,\n        validate=[\n            validate.Length(min=1, max=128, error='User names must not be empty')\n        ]\n    )\n    email = field_for(\n        Users,\n        'email',\n        validate=[\n            validate.Email('Emails must be a properly formatted email address'),\n            validate.Length(min=1, max=128, error='Emails must not be empty'),\n        ]\n    )\n    website = field_for(\n        Users,\n        'website',\n        validate=validate.URL(\n            error='Websites must be a proper URL starting with http or https',\n            schemes={'http', 'https'}\n        )\n    )\n    country = field_for(\n        Users,\n        'country',\n        validate=[\n            validate_country_code\n        ]\n    )\n    password = field_for(\n        Users,\n        'password',\n        validate=[\n            validate.Length(min=1, error='Passwords must not be empty'),\n        ]\n    )\n\n    @pre_load\n    def validate_name(self, data):\n        name = data.get('name')\n        if name is None:\n            return\n\n        existing_user = Users.query.filter_by(name=name).first()\n        if is_admin():\n            user_id = data.get('id')\n            if user_id:\n                if existing_user and existing_user.id != user_id:\n                    raise ValidationError('User name has already been taken', field_names=['name'])\n            else:\n                if existing_user:\n                    raise ValidationError('User name has already been taken', field_names=['name'])\n        else:\n            current_user = get_current_user()\n            if name == current_user.name:\n                return data\n            else:\n                name_changes = get_config('name_changes', default=True)\n                if bool(name_changes) is False:\n                    raise ValidationError('Name changes are disabled', field_names=['name'])\n                if existing_user:\n                    raise ValidationError('User name has already been taken', field_names=['name'])\n\n    @pre_load\n    def validate_email(self, data):\n        email = data.get('email')\n        if email is None:\n            return\n\n        existing_user = Users.query.filter_by(email=email).first()\n\n        if is_admin():\n            user_id = data.get('id')\n            if user_id:\n                if existing_user and existing_user.id != user_id:\n                    raise ValidationError('Email address has already been used', field_names=['email'])\n            else:\n                if existing_user:\n                    raise ValidationError('Email address has already been used', field_names=['email'])\n        else:\n            current_user = get_current_user()\n            if email == current_user.email:\n                return data\n            else:\n                if existing_user:\n                    raise ValidationError('Email address has already been used', field_names=['email'])\n                if check_email_is_whitelisted(email) is False:\n                    raise ValidationError(\n                        \"Only email addresses under {domains} may register\".format(\n                            domains=get_config('domain_whitelist')\n                        ),\n                        field_names=['email']\n                    )\n                if get_config('verify_emails'):\n                    current_user.verified = False\n\n    @pre_load\n    def validate_password_confirmation(self, data):\n        password = data.get('password')\n        confirm = data.get('confirm')\n        target_user = get_current_user()\n        user_id = data.get('id')\n\n        if is_admin():\n            pass\n        else:\n            if password and (confirm is None):\n                raise ValidationError('Please confirm your current password', field_names=['confirm'])\n\n            if password and confirm:\n                test = verify_password(plaintext=confirm, ciphertext=target_user.password)\n                if test is True:\n                    return data\n                else:\n                    raise ValidationError('Your previous password is incorrect', field_names=['confirm'])\n\n    views = {\n        'user': [\n            'website',\n            'name',\n            'country',\n            'affiliation',\n            'bracket',\n            'id',\n            'oauth_id',\n        ],\n        'self': [\n            'website',\n            'name',\n            'email',\n            'country',\n            'affiliation',\n            'bracket',\n            'id',\n            'oauth_id',\n            'password'\n        ],\n        'admin': [\n            'website',\n            'name',\n            'created',\n            'country',\n            'banned',\n            'email',\n            'affiliation',\n            'secret',\n            'bracket',\n            'hidden',\n            'id',\n            'oauth_id',\n            'password',\n            'type',\n            'verified'\n        ]\n    }\n\n    def __init__(self, view=None, *args, **kwargs):\n        if view:\n            if type(view) == str:\n                kwargs['only'] = self.views[view]\n            elif type(view) == list:\n                kwargs['only'] = view\n\n        super(UserSchema, self).__init__(*args, **kwargs)\n", "path": "CTFd/schemas/users.py"}, {"content": "from flask import session\nfrom CTFd.utils.user import is_admin, get_current_team, get_current_user\nfrom CTFd.models import Teams, Users\nfrom CTFd.utils.countries import lookup_country_code\nfrom six.moves.urllib.parse import urlparse, urljoin, quote, unquote\nfrom flask import request\nfrom marshmallow import ValidationError\nimport re\n\n\ndef is_safe_url(target):\n    ref_url = urlparse(request.host_url)\n    test_url = urlparse(urljoin(request.host_url, target))\n    return test_url.scheme in ('http', 'https') and ref_url.netloc == test_url.netloc\n\n\ndef validate_url(url):\n    return urlparse(url).scheme.startswith('http')\n\n\ndef validate_email(email):\n    return bool(re.match(r\"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$)\", email))\n\n\ndef unique_email(email, model=Users):\n    obj = model.query.filter_by(email=email).first()\n    if is_admin():\n        if obj:\n            raise ValidationError('Email address has already been used')\n    if obj and obj.id != get_current_user().id:\n        raise ValidationError('Email address has already been used')\n\n\ndef validate_country_code(country_code):\n    if lookup_country_code(country_code) is None:\n        raise ValidationError('Invalid Country')\n", "path": "CTFd/utils/validators/__init__.py"}], "after_files": [{"content": "from flask import session\nfrom sqlalchemy.sql.expression import union_all\nfrom marshmallow import fields, post_load\nfrom marshmallow import validate, ValidationError, pre_load\nfrom marshmallow.decorators import validates_schema\nfrom marshmallow_sqlalchemy import field_for\nfrom CTFd.models import ma, Users\nfrom CTFd.utils import get_config\nfrom CTFd.utils.validators import unique_email, validate_country_code\nfrom CTFd.utils.user import is_admin, get_current_user\nfrom CTFd.utils.countries import lookup_country_code\nfrom CTFd.utils.crypto import verify_password, hash_password\nfrom CTFd.utils.email import check_email_is_whitelisted\n\n\nclass UserSchema(ma.ModelSchema):\n    class Meta:\n        model = Users\n        include_fk = True\n        dump_only = ('id', 'oauth_id', 'created')\n        load_only = ('password',)\n\n    name = field_for(\n        Users,\n        'name',\n        required=True,\n        validate=[\n            validate.Length(min=1, max=128, error='User names must not be empty')\n        ]\n    )\n    email = field_for(\n        Users,\n        'email',\n        validate=[\n            validate.Email('Emails must be a properly formatted email address'),\n            validate.Length(min=1, max=128, error='Emails must not be empty'),\n        ]\n    )\n    website = field_for(\n        Users,\n        'website',\n        validate=[\n            # This is a dirty hack to let website accept empty strings so you can remove your website\n            lambda website: validate.URL(\n                error='Websites must be a proper URL starting with http or https',\n                schemes={'http', 'https'}\n            )(website) if website else True\n        ]\n    )\n    country = field_for(\n        Users,\n        'country',\n        validate=[\n            validate_country_code\n        ]\n    )\n    password = field_for(\n        Users,\n        'password',\n    )\n\n    @pre_load\n    def validate_name(self, data):\n        name = data.get('name')\n        if name is None:\n            return\n\n        existing_user = Users.query.filter_by(name=name).first()\n        if is_admin():\n            user_id = data.get('id')\n            if user_id:\n                if existing_user and existing_user.id != user_id:\n                    raise ValidationError('User name has already been taken', field_names=['name'])\n            else:\n                if existing_user:\n                    raise ValidationError('User name has already been taken', field_names=['name'])\n        else:\n            current_user = get_current_user()\n            if name == current_user.name:\n                return data\n            else:\n                name_changes = get_config('name_changes', default=True)\n                if bool(name_changes) is False:\n                    raise ValidationError('Name changes are disabled', field_names=['name'])\n                if existing_user:\n                    raise ValidationError('User name has already been taken', field_names=['name'])\n\n    @pre_load\n    def validate_email(self, data):\n        email = data.get('email')\n        if email is None:\n            return\n\n        existing_user = Users.query.filter_by(email=email).first()\n\n        if is_admin():\n            user_id = data.get('id')\n            if user_id:\n                if existing_user and existing_user.id != user_id:\n                    raise ValidationError('Email address has already been used', field_names=['email'])\n            else:\n                if existing_user:\n                    raise ValidationError('Email address has already been used', field_names=['email'])\n        else:\n            current_user = get_current_user()\n            if email == current_user.email:\n                return data\n            else:\n                if existing_user:\n                    raise ValidationError('Email address has already been used', field_names=['email'])\n                if check_email_is_whitelisted(email) is False:\n                    raise ValidationError(\n                        \"Only email addresses under {domains} may register\".format(\n                            domains=get_config('domain_whitelist')\n                        ),\n                        field_names=['email']\n                    )\n                if get_config('verify_emails'):\n                    current_user.verified = False\n\n    @pre_load\n    def validate_password_confirmation(self, data):\n        password = data.get('password')\n        confirm = data.get('confirm')\n        target_user = get_current_user()\n\n        if is_admin():\n            pass\n        else:\n            if password and (bool(confirm) is False):\n                raise ValidationError('Please confirm your current password', field_names=['confirm'])\n\n            if password and confirm:\n                test = verify_password(plaintext=confirm, ciphertext=target_user.password)\n                if test is True:\n                    return data\n                else:\n                    raise ValidationError('Your previous password is incorrect', field_names=['confirm'])\n            else:\n                data.pop('password', None)\n                data.pop('confirm', None)\n\n    views = {\n        'user': [\n            'website',\n            'name',\n            'country',\n            'affiliation',\n            'bracket',\n            'id',\n            'oauth_id',\n        ],\n        'self': [\n            'website',\n            'name',\n            'email',\n            'country',\n            'affiliation',\n            'bracket',\n            'id',\n            'oauth_id',\n            'password'\n        ],\n        'admin': [\n            'website',\n            'name',\n            'created',\n            'country',\n            'banned',\n            'email',\n            'affiliation',\n            'secret',\n            'bracket',\n            'hidden',\n            'id',\n            'oauth_id',\n            'password',\n            'type',\n            'verified'\n        ]\n    }\n\n    def __init__(self, view=None, *args, **kwargs):\n        if view:\n            if type(view) == str:\n                kwargs['only'] = self.views[view]\n            elif type(view) == list:\n                kwargs['only'] = view\n\n        super(UserSchema, self).__init__(*args, **kwargs)\n", "path": "CTFd/schemas/users.py"}, {"content": "from flask import session\nfrom CTFd.utils.user import is_admin, get_current_team, get_current_user\nfrom CTFd.models import Teams, Users\nfrom CTFd.utils.countries import lookup_country_code\nfrom six.moves.urllib.parse import urlparse, urljoin, quote, unquote\nfrom flask import request\nfrom marshmallow import ValidationError\nimport re\n\n\ndef is_safe_url(target):\n    ref_url = urlparse(request.host_url)\n    test_url = urlparse(urljoin(request.host_url, target))\n    return test_url.scheme in ('http', 'https') and ref_url.netloc == test_url.netloc\n\n\ndef validate_url(url):\n    return urlparse(url).scheme.startswith('http')\n\n\ndef validate_email(email):\n    return bool(re.match(r\"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$)\", email))\n\n\ndef unique_email(email, model=Users):\n    obj = model.query.filter_by(email=email).first()\n    if is_admin():\n        if obj:\n            raise ValidationError('Email address has already been used')\n    if obj and obj.id != get_current_user().id:\n        raise ValidationError('Email address has already been used')\n\n\ndef validate_country_code(country_code):\n    if country_code.strip() == \"\":\n        return\n    if lookup_country_code(country_code) is None:\n        raise ValidationError('Invalid Country')\n", "path": "CTFd/utils/validators/__init__.py"}]}