Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes the theme error #859

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

yokwejuste
Copy link
Collaborator

@yokwejuste yokwejuste commented Oct 10, 2023

Summary

Description of PR here...
Closes #858

Changes

  • Adding content to the Makefile for seeding up the theme to the database on running the containers.
add-theme:
	@echo "==="
	@echo "== Add a theme to the database =="
	@echo "==="
	docker-compose -f docker-compose.yml exec web bash -c "echo 'echo \"from zubhub.models import Theme; \
	Theme.objects.create(Theme_Name=\\\"Theme Zubhub\\\", status=\\\"1\\\") if not Theme.objects.filter(Theme_Name=\\\"Theme Zubhub\\\").exists() else None\" | python /zubhub_backend/zubhub/manage.py shell' > /theme.sh"
	docker-compose -f docker-compose.yml exec web bash /theme.sh
	docker-compose -f docker-compose.yml exec web bash -c "rm /theme.sh"
.PHONY: add-theme

Screenshots

  • Previous look:
    image
  • Current look:
    image

Requests / Responses

Before solving the issue

Request
POST /api/theme Returns main template
Type: GET

Response
HTTP/1.1 404 Not found

{
    "detail": "Not found"
}

After solving the issue

Request
POST /api/theme Returns main template
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

Response
HTTP/1.1 200 OK

{
    "id": 1,
    "Theme_Name": "Theme Zubhub",
    "Primary_Color1": "#DC3545",
    "Primary_Color2": "#FDCB00",
    "Primary_Color3": "#00B8C4",
    "Secondary_Color1": "#FFCDD2",
    "Secondary_Color2": "#A94442",
    "Secondary_Color3": "#FFF7D4",
    "Secondary_Color4": "#9F861E",
    "Secondary_Color5": "#E0F6F4",
    "Secondary_Color6": "#03848C",
    "Text_Color1": "#212121",
    "Text_Color2": "#757474",
    "Text_Color3": "#E4E4E4",
    "status": 1
}

zubhub_backend/Makefile Outdated Show resolved Hide resolved
@yokwejuste
Copy link
Collaborator Author

Changes were performed.

@tuxology tuxology merged commit cb0774c into unstructuredstudio:master Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error fetching theme on project initialization
2 participants