when i run :
tutor plugins list
this error raise:
Traceback (most recent call last):
File “main.py”, line 21, in
File “tutor/commands/cli.py”, line 37, in main
File “tutor/commands/plugins.py”, line 121, in add_plugin_commands
File “tutor/plugins.py”, line 236, in iter_installed
File “tutor/plugins.py”, line 203, in iter_installed
File “tutor/plugins.py”, line 150, in iter_installed
File “tutor/serialize.py”, line 7, in load
File “site-packages/yaml/init.py”, line 114, in load
File “site-packages/yaml/constructor.py”, line 49, in get_single_data
File “site-packages/yaml/composer.py”, line 36, in get_single_node
File “site-packages/yaml/composer.py”, line 55, in compose_document
File “site-packages/yaml/composer.py”, line 84, in compose_node
File “site-packages/yaml/composer.py”, line 133, in compose_mapping_node
File “site-packages/yaml/composer.py”, line 84, in compose_node
File “site-packages/yaml/composer.py”, line 127, in compose_mapping_node
File “site-packages/yaml/parser.py”, line 98, in check_event
File “site-packages/yaml/parser.py”, line 439, in parse_block_mapping_key
yaml.parser.ParserError: while parsing a block mapping
in “/root/.local/share/tutor-plugins/myplugin.yml”, line 4, column 3
expected , but found ‘,’
in “/root/.local/share/tutor-plugins/myplugin.yml”, line 5, column 45
[6488] Failed to execute script main
after last error fixed and enabled the new plugin without errors,
the same error again
ProgrammingError: (1146, “Table ‘openedx.custom_reg_form_extrainfo’ doesn’t exist”)
how can i make migration after adding new field to custom form?? after i run:
1-tutor plugins enable custom_reg_form
2-tutor config save
3-tutor images build openedx
4-tutor local init
no things is changed, and i get this error:
OperationalError: (1054, “Unknown column ‘favorite_morta’ in ‘field list’”)
You getting error, because your changes must override old models and migrations. To do that
$ tutor local run lms bash
To delete old migrations
$ ./manage.py lms migrate custom_reg_form zero
$ tutor images build openedx
$ tutor local quickstart # you should see new migrations, if not ? just run
$ tutor local run lms bash
$ ./manage.py lms makemigrations
$ ./manage.py lms migrate
great its work thank you very much :star_struck :
can you share source code of this plugin?
Hi @ejklock,
If this question to me ? Some fork of this repository https://github.com/open-craft/custom-form-app. has good examples. And I agree with you about sharing our experiences and codes. If has not some private or organizational information’s.
Thanks,
Murat
With the help of @ak00001 I could make a few new fields to display on registration page, but on clicking register it freezes and Create Account button greys out.
(Running on Koa)
log tail-100
@regis @qali @ak00001 Can you please help me to resolve this ?
Hi @nadheemabdulla,
It looks like migrations problem, you must rebuild container(production env) after your changes on models, forms and migrations file.
$ tutor images build openedx
$ tutor local quickstart # you should see new migrations, if not ? just run
$ tutor local run lms bash
$ ./manage.py lms makemigrations
$ ./manage.py lms migrate
Thank you so much for the response.
I tried this again-
New registration field is shown but freezes while clicking on Create account
So I tried
which lists
migrations for 'shoppingcart':
lms/djangoapps/shoppingcart/migrations/0005_auto_20201224_0102.py
- Remove field course_enrollment from certificateitem
- Remove field orderitem_ptr from certificateitem
- Remove field created_by from coupon
- Remove field coupon from couponredemption
- Remove field order from couponredemption
- Remove field user from couponredemption
- Remove field orderitem_ptr from courseregcodeitem
- Delete model CourseRegCodeItemAnnotation
- Remove field created_by from courseregistrationcode
- Remove field invoice from courseregistrationcode
- Remove field invoice_item from courseregistrationcode
- Remove field order from courseregistrationcode
- Remove field invoiceitem_ptr from courseregistrationcodeinvoiceitem
- Remove field orderitem_ptr from donation
- Remove field changed_by from donationconfiguration
- Remove field invoice from invoicehistory
- Remove field invoice from invoiceitem
- Remove field created_by from invoicetransaction
- Remove field invoice from invoicetransaction
- Remove field last_modified_by from invoicetransaction
- Remove field user from order
- Remove field order from orderitem
- Remove field user from orderitem
- Remove field course_enrollment from paidcourseregistration
- Remove field orderitem_ptr from paidcourseregistration
- Delete model PaidCourseRegistrationAnnotation
- Remove field course_enrollment from registrationcoderedemption
- Remove field order from registrationcoderedemption
- Remove field redeemed_by from registrationcoderedemption
- Remove field registration_code from registrationcoderedemption
- Delete model CertificateItem
- Delete model Coupon
- Delete model CouponRedemption
- Delete model CourseRegCodeItem
- Delete model CourseRegistrationCode
- Delete model CourseRegistrationCodeInvoiceItem
- Delete model Donation
- Delete model DonationConfiguration
- Delete model Invoice
- Delete model InvoiceHistory
- Delete model InvoiceItem
- Delete model InvoiceTransaction
- Delete model Order
- Delete model OrderItem
- Delete model PaidCourseRegistration
- Delete model RegistrationCodeRedemption
on running
I get
MySQLdb._exceptions.ProgrammingError: (1146, "Table 'openedx.shoppingcart_certificateitem' doesn't exist")
django.db.utils.ProgrammingError: (1146, "Table 'openedx.shoppingcart_certificateitem' doesn't exist")
Thank you again for your time.
Hi,
Actually like this error below was my expectation about custom register form.
django.db.utils.OperationalError: (1054, “Unknown column ‘org_inst’ in ‘field list’”)
But there are many different error which is mostly ecommerce related ? Such as this error below
(1146, “Table ‘openedx.shoppingcart_certificateitem’ doesn’t exist”)
But any way, what kind of custom fields do you want to in your registrations form ? So we can try to make a demo for that.
Thanks
This is actually a very bad idea which is likely to break your platform.
Hi @regis and thanks for warning,
But is it related to Koa or? because after changes on custom models, forms, fields I always use same commands ?
Thanks…
This is not specific to Koa – at least, not that I know of. If you make changes to certain models, then yes you will want to generate migrations, but not for all models. Instead, you probably want to generate models only for your customized application. For instance:
./manage.py lms makemigrations custom_reg_form
Thanks for clarification @regis and sorry for that @nadheemabdulla
I thought that
./manage.py lms makemigrations
effects just models which has been changed(custom_reg_form) after last migrations, not all LMS, CMS… But I will remember that thanks
Thanks again for the help.
I would like to add 1. Gender ( not optional) 2. Date of birth 3. Mobile number and 4 Nationality
to see if it works, I used this fork of Opencraft Custom-form-app (as Opencraft custom form app’s django version is incompatible with Koa)
Hi @nadheemabdulla,
Here is a little demo which is consist of just one extra field(phone number).
It works and has possibility download data as CSV format, from the Django admin side. Actually I tried to make “Gender” and " Date of birth" as Required fields, but that was not easy for me, bacause overridding fileds which already exist, effects the other fields. But you can try that on your test server. And this example from Appsembler
may can help you for overidding existing files.
Thanks and god luck !