Skip to content

Commit

Permalink
Feedback on feedback code
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesstottmoj committed Dec 10, 2024
1 parent fa9b129 commit 896e80f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 6 additions & 1 deletion controlpanel/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from simple_history.admin import SimpleHistoryAdmin

# First-party/Local
from controlpanel.api.models import App, IPAllowlist, S3Bucket, User
from controlpanel.api.models import App, Feedback, IPAllowlist, S3Bucket, User


def make_migration_pending(modeladmin, request, queryset):
Expand Down Expand Up @@ -58,7 +58,12 @@ class IPAllowlistAdmin(SimpleHistoryAdmin):
history_list_display = ("description", "contact", "allowed_ip_ranges")


class FeedbackAdmin(admin.ModelAdmin):
list_display = ("satisfaction_rating", "suggestions", "date_added")


admin.site.register(App, AppAdmin)
admin.site.register(S3Bucket, S3Admin)
admin.site.register(User, UserAdmin)
admin.site.register(IPAllowlist, IPAllowlistAdmin)
admin.site.register(Feedback, FeedbackAdmin)
2 changes: 1 addition & 1 deletion controlpanel/api/models/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Feedback(models.Model):
blank=False,
)

suggestions = models.TextField()
suggestions = models.TextField(blank=True)
date_added = models.DateTimeField(default=timezone.now)

class Meta:
Expand Down
4 changes: 0 additions & 4 deletions controlpanel/frontend/views/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class CreateFeedback(OIDCLoginRequiredMixin, CreateView):
def get_success_url(self):
return reverse_lazy("feedback-thanks")

def form_valid(self, form):
form.save()
return FormMixin.form_valid(self, form)


class FeedbackThanks(OIDCLoginRequiredMixin, TemplateView):
template_name = "feedback-thanks.html"

0 comments on commit 896e80f

Please sign in to comment.