stages/invitation: ensure created_by is set when creating from API
This commit is contained in:
parent
49eb568d3c
commit
5f90f54195
|
@ -43,3 +43,7 @@ class InvitationViewSet(ModelViewSet):
|
|||
|
||||
queryset = Invitation.objects.all()
|
||||
serializer_class = InvitationSerializer
|
||||
|
||||
def perform_create(self, serializer: InvitationSerializer):
|
||||
serializer.instance.created_by = self.request.user
|
||||
return super().perform_create(serializer)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
# Generated by Django 3.1.4 on 2020-12-27 12:10
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("authentik_stages_invitation", "0002_auto_20201225_2143"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="invitation",
|
||||
name="fixed_data",
|
||||
field=models.JSONField(
|
||||
blank=True,
|
||||
default=dict,
|
||||
help_text="Optional fixed data to enforce on user enrollment.",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -7003,7 +7003,6 @@ definitions:
|
|||
- suspicious_request
|
||||
- password_set
|
||||
- token_view
|
||||
- invitation_created
|
||||
- invitation_used
|
||||
- authorize_application
|
||||
- source_linked
|
||||
|
|
Reference in New Issue