mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-11 17:16:59 -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):
|
class InviteLinkAdmin(admin.ModelAdmin):
|
||||||
list_display = (
|
list_display = (
|
||||||
'group', 'valid_until',
|
'group', 'valid_until','space',
|
||||||
'created_by', 'created_at', 'used_by'
|
'created_by', 'created_at', 'used_by'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,10 @@ class InviteLinkCreate(GroupRequiredMixin, CreateView):
|
|||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
obj = form.save(commit=False)
|
obj = form.save(commit=False)
|
||||||
obj.created_by = self.request.user
|
obj.created_by = self.request.user
|
||||||
obj.space = self.request.space
|
|
||||||
|
# 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()
|
obj.save()
|
||||||
if obj.email:
|
if obj.email:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user