mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-08 07:38:26 -05:00
fixed space not honourd in invite link
This commit is contained in:
@@ -257,7 +257,7 @@ admin.site.register(ViewLog, ViewLogAdmin)
|
||||
|
||||
class InviteLinkAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
'group', 'valid_until',
|
||||
'group', 'valid_until','space',
|
||||
'created_by', 'created_at', 'used_by'
|
||||
)
|
||||
|
||||
|
||||
@@ -201,6 +201,9 @@ class InviteLinkCreate(GroupRequiredMixin, CreateView):
|
||||
def form_valid(self, form):
|
||||
obj = form.save(commit=False)
|
||||
obj.created_by = self.request.user
|
||||
|
||||
# verify given space is actually owned by the user creating the link
|
||||
if obj.space.created_by != self.request.user:
|
||||
obj.space = self.request.space
|
||||
obj.save()
|
||||
if obj.email:
|
||||
|
||||
Reference in New Issue
Block a user