sleede / fab-manager

Fab-Manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.
http://www.fab-manager.com
Other
227 stars 113 forks source link

Impossibilité de réserver des créneaux sur les espaces #84

Closed julienrat closed 7 years ago

julienrat commented 7 years ago

Nous avons créé des espaces et il nous est impossible de réserver des créneaux sur ceux-ci .. le lien "réserver" ne renvoie nulle part

sylvainbx commented 7 years ago

Bonjour, Peux-tu préciser ton problème, car nous ne le rencontrons pas du tout de notre côté ? De quel lien veux-tu parler ?

julienrat commented 7 years ago

En ce qui concerne les machines, pas de soucis pour les réserver, le bouton "reserver" nous ramene bien sur le calendrier de reservation, c'est sur les espaces que cela pose soucis, le bouton "reserver" ne nous renvoie nullepart (le bouton semble inactif)

J'ai cette erreur dans mon navigateur quand je clique sur le bouton application-2e98f4c….js:199 GET https://fablab.lesusinesnouvelles.com/api/availabilities/spaces/electronique 500 (Internal Server Error) (anonymous) @ application-2e98f4c….js:199 sendReq @ application-2e98f4c….js:199 serverRequest @ application-2e98f4c….js:199 processQueue @ application-2e98f4c….js:200 (anonymous) @ application-2e98f4c….js:200 $eval @ application-2e98f4c….js:200 $digest @ application-2e98f4c….js:200 $apply @ application-2e98f4c….js:200 (anonymous) @ application-2e98f4c….js:204 dispatch @ application-2e98f4c….js:30 elemData.handle @ application-2e98f4c….js:30

sylvainbx commented 7 years ago

Peux-tu nous donner la sortie de tail -f log/app-stdout.log lorsque le problème se produit ?

julienrat commented 7 years ago

root@vps309910:/home/core/fabmanager# tail -f log/app-stdout.log Setting Load (6.2ms) SELECT "settings". FROM "settings" WHERE "settings"."name" IN ('booking_window_start', 'booking_window_end', 'booking_move_enable', 'booking_move_delay', 'booking_cancel_enable', 'booking_cancel_delay', 'subscription_explications_alert', 'space_explications_alert') Rendered api/settings/index.json.jbuilder (7.4ms) SpaceImage Load (1.7ms) SELECT "assets". FROM "assets" WHERE "assets"."type" IN ('SpaceImage') AND "assets"."viewable_id" = $1 AND "assets"."viewable_type" = $2 LIMIT 1 [["viewable_id", 2], ["viewable_type", "Space"]] Completed 200 OK in 23ms (Views: 4.2ms | ActiveRecord: 6.1ms | Elasticsearch: 0.0ms) Rendered api/spaces/show.json.jbuilder (6.1ms) Completed 200 OK in 45ms (Views: 6.5ms | ActiveRecord: 5.7ms | Elasticsearch: 0.0ms) Completed 200 OK in 18ms (Views: 1.7ms | ActiveRecord: 6.2ms | Elasticsearch: 0.0ms) PlanFile Load (3.3ms) SELECT "assets". FROM "assets" WHERE "assets"."type" IN ('PlanFile') AND "assets"."viewable_type" = 'Plan' AND "assets"."viewable_id" IN (8, 10, 2, 1) Rendered api/plans/index.json.jbuilder (31.4ms) Completed 200 OK in 36ms (Views: 23.6ms | ActiveRecord: 8.6ms | Elasticsearch: 0.0ms) Started GET "/api/spaces/electronique" for 78.206.32.41 at 2017-09-12 10:30:56 +0000 Started GET "/api/availabilities/spaces/electronique" for 78.206.32.41 at 2017-09-12 10:30:56 +0000 Processing by API::SpacesController#show as JSON Processing by API::AvailabilitiesController#spaces as JSON Parameters: {"space_id"=>"electronique"} Parameters: {"id"=>"electronique"} User Load (0.8ms) SELECT "users". FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 22]] Space Load (2.7ms) SELECT "spaces". FROM "spaces" WHERE "spaces"."slug" = $1 ORDER BY "spaces"."id" ASC LIMIT 1 [["slug", "electronique"]] Setting Load (0.5ms) SELECT "settings". FROM "settings" WHERE "settings"."name" = $1 LIMIT 1 [["name", "visibility_yearly"]] Completed 500 Internal Server Error in 17ms (ActiveRecord: 1.3ms | Elasticsearch: 0.0ms)

NoMethodError (undefined method value' for nil:NilClass): app/controllers/api/availabilities_controller.rb:443:indefine_max_visibility'

SpaceFile Load (5.1ms) SELECT "assets". FROM "assets" WHERE "assets"."type" IN ('SpaceFile') AND "assets"."viewable_type" = 'Space' AND "assets"."viewable_id" IN (2) HABTM_Projects Load (0.5ms) SELECT "projects_spaces". FROM "projects_spaces" WHERE "projects_spaces"."space_id" IN (2) Started GET "/api/groups" for 78.206.32.41 at 2017-09-12 10:30:56 +0000 Started GET "/api/plans" for 78.206.32.41 at 2017-09-12 10:30:56 +0000 SpaceImage Load (1.7ms) SELECT "assets". FROM "assets" WHERE "assets"."type" IN ('SpaceImage') AND "assets"."viewable_id" = $1 AND "assets"."viewable_type" = $2 LIMIT 1 [["viewable_id", 2], ["viewable_type", "Space"]] Processing by API::GroupsController#index as JSON Started GET "/api/settings?names=%5B%27booking_window_start%27,+%27booking_window_end%27,+%27booking_move_enable%27,+%27booking_move_delay%27,+%27booking_cancel_enable%27,+%27booking_cancel_delay%27,+%27subscription_explications_alert%27,+%27space_explications_alert%27%5D" for 78.206.32.41 at 2017-09-12 10:30:56 +0000 Processing by API::PlansController#index as JSON Rendered api/spaces/show.json.jbuilder (9.8ms) Processing by API::SettingsController#index as JSON Parameters: {"names"=>"['booking_window_start', 'booking_window_end', 'booking_move_enable', 'booking_move_delay', 'booking_cancel_enable', 'booking_cancel_delay', 'subscription_explications_alert', 'space_explications_alert']"} Completed 200 OK in 40ms (Views: 18.5ms | ActiveRecord: 10.0ms | Elasticsearch: 0.0ms) Plan Load (3.9ms) SELECT "plans". FROM "plans" Setting Load (4.2ms) SELECT "settings". FROM "settings" WHERE "settings"."name" IN ('booking_window_start', 'booking_window_end', 'booking_move_enable', 'booking_move_delay', 'booking_cancel_enable', 'booking_cancel_delay', 'subscription_explications_alert', 'space_explications_alert') Rendered api/settings/index.json.jbuilder (6.0ms) Completed 200 OK in 9ms (Views: 2.5ms | ActiveRecord: 4.2ms | Elasticsearch: 0.0ms) User Load (15.8ms) SELECT "users". FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 22]] PlanFile Load (4.5ms) SELECT "assets". FROM "assets" WHERE "assets"."type" IN ('PlanFile') AND "assets"."viewable_type" = 'Plan' AND "assets"."viewable_id" IN (8, 10, 2, 1) Rendered api/plans/index.json.jbuilder (17.1ms) Completed 200 OK in 20ms (Views: 9.6ms | ActiveRecord: 8.4ms | Elasticsearch: 0.0ms) Role Load (3.0ms) SELECT "roles". FROM "roles" INNER JOIN "users_roles" ON "roles"."id" = "users_roles"."role_id" WHERE "users_roles"."user_id" = $1 AND (((roles.name = 'admin') AND (roles.resource_type IS NULL) AND (roles.resource_id IS NULL))) [["user_id", 22]] Group Load (0.5ms) SELECT "groups". FROM "groups" WHERE ("groups"."slug" != $1) [["slug", "admins"]] Rendered api/groups/_group.json.jbuilder (0.2ms) Rendered api/groups/_group.json.jbuilder (0.1ms) Rendered api/groups/_group.json.jbuilder (0.1ms) Rendered api/groups/index.json.jbuilder (3.5ms) Completed 200 OK in 31ms (Views: 3.9ms | ActiveRecord: 19.3ms | Elasticsearch: 0.0ms) Started GET "/api/notifications/polling?last_poll=2017-09-12T10:26:27.846Z" for 78.206.32.41 at 2017-09-12 10:30:57 +0000 Processing by API::NotificationsController#polling as JSON Parameters: {"last_poll"=>"2017-09-12T10:26:27.846Z"} User Load (0.8ms) SELECT "users". FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 22]] (0.7ms) SELECT COUNT() FROM "notifications" WHERE "notifications"."receiver_id" = $1 AND "notifications"."receiver_type" = $2 [["receiver_id", 22], ["receiver_type", "User"]] (0.4ms) SELECT COUNT() FROM "notifications" WHERE "notifications"."receiver_id" = $1 AND "notifications"."receiver_type" = $2 AND "notifications"."is_read" = $3 [["receiver_id", 22], ["receiver_type", "User"], ["is_read", "f"]] Notification Load (0.7ms) SELECT "notifications". FROM "notifications" WHERE "notifications"."receiver_id" = $1 AND "notifications"."receiver_type" = $2 AND (is_read = false AND created_at >= '2017-09-12T10:26:27.846Z') ORDER BY created_at DESC [["receiver_id", 22], ["receiver_type", "User"]] Rendered api/notifications/index.json.jbuilder (2.4ms) Completed 200 OK in 13ms (Views: 2.7ms | ActiveRecord: 2.6ms | Elasticsearch: 0.0ms) Started GET "/api/notifications/polling?last_poll=2017-09-12T10:30:27.547Z" for 78.206.32.41 at 2017-09-12 10:30:58 +0000 Processing by API::NotificationsController#polling as JSON Parameters: {"last_poll"=>"2017-09-12T10:30:27.547Z"} User Load (0.8ms) SELECT "users". FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]] (1.3ms) SELECT COUNT() FROM "notifications" WHERE "notifications"."receiver_id" = $1 AND "notifications"."receiver_type" = $2 [["receiver_id", 1], ["receiver_type", "User"]] (0.9ms) SELECT COUNT() FROM "notifications" WHERE "notifications"."receiver_id" = $1 AND "notifications"."receiver_type" = $2 AND "notifications"."is_read" = $3 [["receiver_id", 1], ["receiver_type", "User"], ["is_read", "f"]] Notification Load (1.3ms) SELECT "notifications".* FROM "notifications" WHERE "notifications"."receiver_id" = $1 AND "notifications"."receiver_type" = $2 AND (is_read = false AND created_at >= '2017-09-12T10:30:27.547Z') ORDER BY created_at DESC [["receiver_id", 1], ["receiver_type", "User"]] Rendered api/notifications/index.json.jbuilder (3.1ms) Completed 200 OK in 14ms (Views: 2.7ms | ActiveRecord: 4.2ms | Elasticsearch: 0.0ms)

sylvainbx commented 7 years ago

Est-tu sur d'avoir lancé la commande rake db:seed lors de la dernière mise à jour ? Dans le doute, tu peux la relancer puis tester à nouveau.

julienrat commented 7 years ago

Résolu ! J'ai fait un docker-compose run --rm fabmanager bundle exec rake db:seed Mais ce n’était pas indiqué dans la TO DO DEPLOY si ?

sylvainbx commented 7 years ago

Si mais il est possible qu'avec l'oubli de la tâche rake db:migrate, celle-ci n'ait pas fonctionné correctement, dans la mesure où rake db:migratedoit normalement être exécutée en premier.