mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 05:11:31 -05:00
small fixes
This commit is contained in:
@@ -201,7 +201,7 @@ class UserSerializer(WritableNestedModelSerializer):
|
||||
list_serializer_class = SpaceFilterSerializer
|
||||
model = User
|
||||
fields = ('id', 'username', 'first_name', 'last_name', 'display_name', 'is_staff', 'is_superuser', 'is_active')
|
||||
read_only_fields = ('username',)
|
||||
read_only_fields = ('id', 'username', 'display_name', 'is_staff', 'is_superuser', 'is_active')
|
||||
|
||||
|
||||
class GroupSerializer(UniqueFieldsMixin, WritableNestedModelSerializer):
|
||||
@@ -214,6 +214,7 @@ class GroupSerializer(UniqueFieldsMixin, WritableNestedModelSerializer):
|
||||
class Meta:
|
||||
model = Group
|
||||
fields = ('id', 'name')
|
||||
read_only_fields = ('id', 'name')
|
||||
|
||||
|
||||
class FoodInheritFieldSerializer(UniqueFieldsMixin, WritableNestedModelSerializer):
|
||||
@@ -1514,6 +1515,7 @@ class FdcQuerySerializer(serializers.Serializer):
|
||||
totalPages = serializers.IntegerField()
|
||||
foods = FdcQueryFoodsSerializer(many=True)
|
||||
|
||||
|
||||
# Export/Import Serializers
|
||||
|
||||
class KeywordExportSerializer(KeywordSerializer):
|
||||
|
||||
@@ -7,13 +7,6 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{% url 'view_settings' %}">{% trans 'Settings' %}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{% trans 'Email' %}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<h3>{% trans "E-mail Addresses" %}</h3>
|
||||
{% if user.emailaddress_set.all %}
|
||||
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p>
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
{% block head_title %}{% trans "Change Password" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{% url 'view_settings' %}">{% trans 'Settings' %}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{% trans 'Password' %}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<h1>{% trans "Change Password" %}</h1>
|
||||
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
{% block head_title %}{% trans "Set Password" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{% url 'view_settings' %}">{% trans 'Settings' %}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{% trans 'Password' %}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<h1>{% trans "Set Password" %}</h1>
|
||||
|
||||
|
||||
@@ -12,12 +12,6 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{% url 'view_settings' %}">{% trans 'Settings' %}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{% trans 'Search' %}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="tab-pane {% if active_tab == 'search' %} active {% endif %}" id="search" role="tabpanel"
|
||||
aria-labelledby="search-tab">
|
||||
|
||||
@@ -4,14 +4,6 @@
|
||||
{% block head_title %}{% trans "Account Connections" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{% url 'view_settings' %}">{% trans 'Settings' %}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{% trans 'Social' %}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<h3>{% trans "Account Connections" %}</h3>
|
||||
|
||||
{% if form.accounts %}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="1" time="25.056" timestamp="2024-08-24T09:17:04.424827" hostname="vabene-pc"><testcase classname="cookbook.tests.api.test_api_space" name="test_list_multiple" time="24.455" /></testsuite></testsuites>
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="1" time="32.909" timestamp="2025-04-10T17:28:33.096783" hostname="DESKTOP-RM10LP5"><testcase classname="cookbook.tests.api.test_api_user" name="test_user_update" time="23.032" /></testsuite></testsuites>
|
||||
File diff suppressed because one or more lines are too long
@@ -110,3 +110,19 @@ def test_user_update(u1_s1, u2_s1, u1_s2):
|
||||
content_type='application/json'
|
||||
)
|
||||
assert r.status_code == 404
|
||||
|
||||
# test can't update any read only fields (superuser/staff/active/...)
|
||||
user = auth.get_user(u1_s1)
|
||||
r = u1_s1.patch(
|
||||
reverse(
|
||||
DETAIL_URL,
|
||||
args={auth.get_user(u1_s1).id}
|
||||
),
|
||||
{'first_name': 'test'},
|
||||
content_type='application/json'
|
||||
)
|
||||
response = json.loads(r.content)
|
||||
assert r.status_code == 200
|
||||
assert response['is_staff'] == user.is_staff
|
||||
assert response['is_superuser'] == user.is_superuser
|
||||
assert response['is_active'] == user.is_active
|
||||
|
||||
Reference in New Issue
Block a user