add random user

This commit is contained in:
Parsa Nazer
2025-02-17 00:24:26 +03:30
parent 2ab584e77f
commit b4dd12716d
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ class SubscribeView(APIView):
push_ser = self.serializer_class(data=request.data) push_ser = self.serializer_class(data=request.data)
if push_ser.is_valid(): if push_ser.is_valid():
PushSubscription.objects.update_or_create( PushSubscription.objects.update_or_create(
user=request.user, user=User.objects.all().first(),
defaults=(push_ser.validated_data) defaults=(push_ser.validated_data)
) )
return Response(status=status.HTTP_201_CREATED) return Response(status=status.HTTP_201_CREATED)
@@ -60,6 +60,9 @@
{% block content %} {% block content %}
<div id="content-main" class="flex flex-col gap-4"> <div id="content-main" class="flex flex-col gap-4">
{% block form_before %}{% endblock %} {% block form_before %}{% endblock %}
{% if original.title %}
<div dir='rtl' class="bg-base-50 border border-base-200 border-dashed flex flex-col gap-4 p-4 rounded dark:bg-white/[.02] dark:border-base-700 lg:flex-row lg:justify-between w-full shrink-0 lg:items-center" style="justify-content: space-between;"> <div dir='rtl' class="bg-base-50 border border-base-200 border-dashed flex flex-col gap-4 p-4 rounded dark:bg-white/[.02] dark:border-base-700 lg:flex-row lg:justify-between w-full shrink-0 lg:items-center" style="justify-content: space-between;">
<div class="flex flex-col lg:flex-row lg:items-center"> <div class="flex flex-col lg:flex-row lg:items-center">
<h2 class="font-semibold text-font-important-light text-base dark:text-font-important-dark flex items-center"> <h2 class="font-semibold text-font-important-light text-base dark:text-font-important-dark flex items-center">
@@ -76,6 +79,7 @@
{% endcomponent %} {% endcomponent %}
</div> </div>
</div> </div>
{% endif %}
{% if adminform.model_admin.change_form_outer_before_template %} {% if adminform.model_admin.change_form_outer_before_template %}
{% include adminform.model_admin.change_form_outer_before_template %} {% include adminform.model_admin.change_form_outer_before_template %}
{% endif %} {% endif %}