mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
fix sas album creation rights
This commit is contained in:
@ -27,7 +27,9 @@ class AlbumCreateForm(forms.ModelForm):
|
||||
self.instance.moderator = owner
|
||||
|
||||
def clean(self):
|
||||
if not self.instance.owner.can_edit(self.instance.parent):
|
||||
parent = self.cleaned_data["parent"]
|
||||
parent.__class__ = Album # by default, parent is a SithFile
|
||||
if not self.instance.owner.can_edit(parent):
|
||||
raise ValidationError(_("You do not have the permission to do that"))
|
||||
return super().clean()
|
||||
|
||||
|
Reference in New Issue
Block a user