Don't allow non-staff users to impersonate other users in event form
This commit is contained in:
parent
e02ba33348
commit
48e5ec1ca3
@ -15,3 +15,6 @@ class EventForm(forms.ModelForm):
|
||||
|
||||
self.fields['date'].initial = datetime.now()
|
||||
self.fields['user'].initial = user
|
||||
if not user.is_staff:
|
||||
print(list(self.fields['user'].choices))
|
||||
self.fields['user'].choices = [(user.id, user)]
|
||||
|
Loading…
Reference in New Issue
Block a user