Create default room categories on establishment registration

Closing #9
This commit is contained in:
Kumi 2021-05-30 13:55:10 +02:00
parent 30a91d1ce7
commit 5cfdb9400b

View file

@ -130,7 +130,12 @@ class EstablishmentRequestView(InConstructionMixin, PartnerProfileRequiredMixin,
def form_valid(self, form):
form.instance.owner = self.request.user.partnerprofile
return super().form_valid(form)
retval = super().form_valid(form)
RoomCategory.objects.create(name="Einzelzimmer", average_price=100, active=False, establishment=form.instance) # TODO: Move somewhere better
RoomCategory.objects.create(name="Doppelzimmer", average_price=100, active=False, establishment=form.instance)
return retval
def get_success_url(self):
return reverse_lazy("partners:establishments")