Skip to content

Commit

Permalink
conflict removed
Browse files Browse the repository at this point in the history
  • Loading branch information
prshnt19 committed Feb 18, 2019
1 parent 2f88430 commit c37a30e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
4 changes: 3 additions & 1 deletion forms/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class BookingEntry(admin.ModelAdmin):
list_display = ( "bookingID", "user", "roomID", "name", "arrive", "depart")
class UserProfileEntry(admin.ModelAdmin):
list_display = ("user", "verified", "booking_mail_sent", "arrive", "depart", "street", "city", "reference_email")
class FeedBackEntry(admin.ModelAdmin):
list_display = ("name","subject","message")

# admin.site.register(FormSubmit,AllEntryAdmin)
admin.site.register(Room,RoomEntry)
# admin.site.register(Booking,BookingEntry)
admin.site.register(FeedbackSubmit)
admin.site.register(FeedbackSubmit,FeedBackEntry)
admin.site.register(UserProfile,UserProfileEntry)

class ProfileInline(admin.StackedInline):
Expand Down
20 changes: 20 additions & 0 deletions forms/migrations/0003_auto_20190218_2331.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.1.5 on 2019-02-18 18:01

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('forms', '0002_feedbacksubmit'),
]

operations = [
migrations.AlterField(
model_name='feedbacksubmit',
name='name',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
]
2 changes: 1 addition & 1 deletion forms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FormSubmit(models.Model):

class FeedbackSubmit(models.Model):
"""docstring for FeedbackSubmit"""
name=models.CharField(max_length=30)
name=models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
subject=models.CharField(max_length=30)
message=models.TextField(max_length=1000)

Expand Down
8 changes: 3 additions & 5 deletions forms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,19 @@ def lat_ajax(request):
# response = HttpResponse(pdf_file, content_type='application/pdf')
# response['Content-Disposition'] = 'filename="home_page.pdf"'
# return response

@login_required
def feedback_submit(request):
user=request.user
name=user.username
subject=request.POST["subject"]
message=request.POST["message"]
feedbacksubmit=FeedbackSubmit(name=name,subject=subject,message=message)
feedbacksubmit=FeedbackSubmit(name=user, subject=subject, message=message)
feedbacksubmit.save()
return render(request,"room/feedbacksubmitted.html")

def feedback_form(request):
return render(request,"room/feedbackform.html")




def form_submit(request):
name=request.POST["name"]
email=request.POST["email"]
Expand Down

0 comments on commit c37a30e

Please sign in to comment.