[mezzanine-users] Can't upload images

2017-02-05 Thread marvel tales
Hello,

I am having an issue with image upload on Mezzanine CMS. I have this screen 
on Mozilla.


And this screen on Chrome

I will appreciate a lot if someone can help me.

Thanks in advance

 

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] staff member unable to login to admin

2017-02-05 Thread CJWalther
Hi

(sorry for my belated reply -- seems to be an on-and-off weekend only 
project... many other balls to keep on track...)

Yes, inserting 

 {{ request.META.HTTP_HOST }}

helped to diagnose and heal the problem, as in fact site info differed...

It might be helpful to show the current site on the admin dashboard when 
changing a user account in the Site permissions panel. This might have led 
me in the right direction as, yes, I haven't fully grasped the concept of 
sites (amongst many, many other things)

Thanks!

On Monday, January 30, 2017 at 4:36:06 AM UTC+1, Stephen McDonald wrote:
>
>
> BTW a quick trick for checking my last point is adding the following line 
> to a template:
>
> http host is: {{ request.META.HTTP_HOST }}
>
> (
> https://docs.djangoproject.com/en/1.10/ref/request-response/#django.http.HttpRequest.META
> )
> -- 
> Stephen McDonald
> http://jupo.org
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Can't upload images

2017-02-05 Thread Stephen McDonald
Looks like you're using an older version that depends on the Flash
plugin. So you can either install that, or upgrade Mezzanine +
dependencies.

On 2/6/17, marvel tales  wrote:
> Hello,
>
> I am having an issue with image upload on Mezzanine CMS. I have this screen
>
> on Mozilla.
>
>
> And this screen on Chrome
>
> I will appreciate a lot if someone can help me.
>
> Thanks in advance
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Can't upload images

2017-02-05 Thread marvel tales
Thank you very much for your answer.
I am very new to Mezzanine CMS.
Could you please guide me to a source which shows how to properly update 
Mezzanine and dependencies.
As now what I am thinking is, creating a new virtualenv and installing 
everything from the beginning  fresh.
I don't know if it is a good way of doing things.
Many thanks


On Sunday, February 5, 2017 at 11:44:56 PM UTC+1, Stephen McDonald wrote:
>
> Looks like you're using an older version that depends on the Flash 
> plugin. So you can either install that, or upgrade Mezzanine + 
> dependencies. 
>
> On 2/6/17, marvel tales > wrote: 
> > Hello, 
> > 
> > I am having an issue with image upload on Mezzanine CMS. I have this 
> screen 
> > 
> > on Mozilla. 
> > 
> > 
> > And this screen on Chrome 
> > 
> > I will appreciate a lot if someone can help me. 
> > 
> > Thanks in advance 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Mezzanine Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to mezzanine-use...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
> > 
>
>
> -- 
> Stephen McDonald 
> http://jupo.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Can't upload images

2017-02-05 Thread Stephen McDonald
On Mon, Feb 6, 2017 at 10:07 AM, marvel tales  wrote:

> Thank you very much for your answer.
> I am very new to Mezzanine CMS.
> Could you please guide me to a source which shows how to properly update
> Mezzanine and dependencies.
> As now what I am thinking is, creating a new virtualenv and installing
> everything from the beginning  fresh.
> I don't know if it is a good way of doing things.
>

That should work


> Many thanks
>
>
> On Sunday, February 5, 2017 at 11:44:56 PM UTC+1, Stephen McDonald wrote:
>>
>> Looks like you're using an older version that depends on the Flash
>> plugin. So you can either install that, or upgrade Mezzanine +
>> dependencies.
>>
>> On 2/6/17, marvel tales  wrote:
>> > Hello,
>> >
>> > I am having an issue with image upload on Mezzanine CMS. I have this
>> screen
>> >
>> > on Mozilla.
>> >
>> >
>> > And this screen on Chrome
>> >
>> > I will appreciate a lot if someone can help me.
>> >
>> > Thanks in advance
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Mezzanine Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to mezzanine-use...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> --
>> Stephen McDonald
>> http://jupo.org
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Sending an email to admins on new user profile creation

2017-02-05 Thread Stephen McDonald
Just spent some time looking into this - there's actually a setting
ACCOUNTS_PROFILE_FORM_CLASS (
http://mezzanine.jupo.org/docs/configuration.html#accounts-profile-form-class)
which allows you to specify a custom form class for user profile
signup/update. You could override the save method of it and send an email
via that, something like (untested):

# settings.py

ACCOUNTS_PROFILE_FORM_CLASS = "myapp.forms.MyCustomProfileForm"

# myapp.forms.py

from mezzanine.account.forms import ProfileForm

class MyCustomProfileForm(ProfileForm):
def save(self, *args, **kwargs):
user = super(MyCustomProfileForm, self).save(*args, **kwargs)
if self._signup:
# send email
return user

On Thu, Feb 2, 2017 at 10:02 PM, Christian Hill  wrote:

> Unfortunately, I don't think this will work very reliably: the time of
> update and time of creation will be a little bit different, so I can't
> check for strict equality, but the two UserProfile save events occur close
> together, so I can't choose a reliable timedelta to ascertain whether the
> instance is begin saved the first time or the second time. For example, the
> output from
>
> def email_admins_on_new_signup(sender, instance, **kwargs):
> print('created:', instance.profile_created)
> print('updated:', instance.profile_updated)
>
> is:
>
> created: 2017-02-02 10:53:51.575074+00:00
> updated: 2017-02-02 10:53:51.575115+00:00
> created: 2017-02-02 10:53:51.575074+00:00
> updated: 2017-02-02 10:53:51.578555+00:00
>
> A workaround is:
> if not kwargs['created'] and instance.profile_updated -
> instance.profile_created < timedelta(seconds=5):
> # Only send an email if a new UserProfile was created.
> send_signup_alert_email_to_admins(instance)
>
> – i.e. only send the email if the instance save is after initial creation,
> but within 5 seconds of it, but that feels awfully hacky and I'd love a
> better solution.
>
>
> On 2 February 2017 at 03:08, Melvyn Sopacua  wrote:
>
>> On Wednesday 01 February 2017 07:02:30 Christian Hill wrote:
>>
>> > And I don't want
>>
>> > the email sent if the user is simply editing their profile.
>>
>> > Would I be better off customizing the accounts app?
>>
>>
>>
>> Add two fields to your profile:
>>
>>- profile_created: DateTimeField(auto_now_add=True)
>>- profile_updated: DateTimeField(auto_now=True)
>>
>> If they're equal, you send mail.
>>
>>
>>
>> >
>>
>> > On 1 February 2017 at 00:27, Stephen McDonald  wrote:
>>
>> > > On Wed, Feb 1, 2017 at 8:46 AM, Christian Hill 
>> wrote:
>>
>> > >> Presumably UserProfile is saved twice and I'm only picking up the
>>
>> > >> first time, after it's been attached to a user but before the
>>
>> > >> extra data is attached to it.
>>
>> > >
>>
>> > > If that's true, then the signal handler would run each time, which
>>
>> > > means you could then modify it to check for the expected data
>>
>> > > (affiliation) and only send the email then.
>>
>> > >
>>
>> > >
>>
>> > > --
>>
>> > > Stephen McDonald
>>
>> > > http://jupo.org
>>
>> > >
>>
>> > > --
>>
>> > > You received this message because you are subscribed to the Google
>>
>> > > Groups "Mezzanine Users" group.
>>
>> > > To unsubscribe from this group and stop receiving emails from it,
>>
>> > > send an email to mezzanine-users+unsubscr...@googlegroups.com.
>>
>> > > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>>
>> Melvyn Sopacua
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mezzanine-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> My book, Learning Scientific Programming with Python is published by CUP
> 
> scipython.com: | @scipython3 
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] displayable_link.js is not generated - development server

2017-02-05 Thread Stephen McDonald
Just pushed a fix for this:

https://github.com/stephenmcd/mezzanine/commit/23c15f8b78f440a6a81e686fcd4ef772d44854bd

On Fri, Jan 27, 2017 at 12:08 PM, Danny  wrote:

> Hi Lucas,
>
> I've also just noticed that the "Link List" feature is no longer working
> as of Mezzanine 4.2.2 (on either the admin side or the front end) and is
> still broken at HEAD.
> It appears to be some ordering error with regards to when tinymce_setup.js
> is executed vs when the scripts in admin/base_site.html or
> editable_loader.html are parsed to set up the window.__link_list_url
> variable.
>
> I've opened this issue: https://github.com/stephenmcd/
> mezzanine/issues/1728
>
> However, Javascript is not my forte, so debugging this is a little beyond
> me. Hopefully someone else can assist.
>
> [BTW, if you're worried about displayable_links.js not being generated
> properly, just visit admin/displayable_links.js directly - and if it
> returns you a lovely structure of links, then that isn't your issue.]
>
> Best of luck,
>
> Seeya. Danny.
>
>
> On 25/01/2017 7:32 AM, Lucas Corso wrote:
>
> Hello, I have more or less the same problem that Danny presents at:
>
> --> https://groups.google.com/forum/#!searchin/mezzanine-
> users/displayable_links.js|sort:relevance/mezzanine-
> users/6ZgJtRF9VWk/6cR6p0cnAwAJ
>
>
> In my case I'm running mezzanine on a development server, at first I
> thought it was some missing package, but then I realized that the problem
> was that displayable_link.js was not being generated when I clicked the
> link button on the panel Tools to publish.
>
>
>
>
>
> 
>
> What has worked so far is what clarifies Danny to delete templates / admin
> / base_site.html and if it works
>
>
>
> 
>
> But some styles are lost in the administration site
>
>
>
> 
>
> Compared to the normal style
>
>
> 
>
> What could I do to fix it? Thanks for reading...
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] [Cartridge] - Admin links to custom product type no longer work

2017-02-05 Thread Stephen McDonald
Hi there,

Subclassing the product model was previously not a supported feature - I
imagine you had to do some extensive hacking to get that working in the
actual site.

It now is a supported feature however, much like the Page model in
Mezzanine can be subclasses to create custom page types, custom products
now work the same in the development version of Cartridge.

The good news is that what you've done should mostly work now - it's just
that your existing products are missing a value that identifies them as
your BaseProduct custom product type - if you inspect the DB somehow,
you'll see the table for the Product model has a "content_type" field (if I
recall correctly), and it stores a string name for the type of product it's
related to, in your case I think the value would be "baseproduct", but the
best way to know for sure would be to add a new product of "BaseProduct"
type, and see what value gets stored for that.

BTW the redirection is occurring because with this new version, *all*
product subclasses in the admin will redirect to one listing page where
they all get managed. You'll see an "Add product" dropdown list (presumably
with only one item in it in your case, namely BaseProduct), which is how
you choose which type of product you're adding. You'll need to use that to
perform the check I just mentioned. Given the way the admin works now,
you'll also be able to remove BaseProduct from the ADMIN_MENU_ORDER setting
you have, since that's redundant.





On Thu, Jan 26, 2017 at 1:22 AM, Pete Dermott 
wrote:

> Apologies if this this an existing issue or I'm missing something but I am
> having a little trouble with my cartridge installation and my custom
> product types, I am running on the current versions of Mezzanine and
> Cartridge from the GitHub repos.
>
> Previously I have declared my custom product type in the settings.py file
> as follows:
>
> ADMIN_MENU_ORDER = (
> ...
> ("My Shop", (
> "my_shop.BaseProduct",
> )),
>
> ...
>
>
> .. in my models as:
>
> from cartridge.shop.models import Product, Category, ProductVariation, 
> ProductImage
>
>
> ...
>
>
> class BaseProduct(Product):
> cadfile = fields.FileField(upload_to="product/cadfile", 
> extensions=(".dwg",), blank=True, null=True, help_text="Format: Files should 
> be named in all lower case with leading zeros and ONLY product codes e.g 
> rg09.dwg")
> pdffile = fields.FileField(upload_to="product/pdffile", blank=True, 
> null=True, help_text="Format: Files should be named in all lower case with 
> leading zeros and ONLY product codes e.g pm01.pdf")
> product_code = models.CharField(max_length=8, help_text="Format: All 
> caps, no spaces, include leading zero's, e.g DC01B")
>
> ...
>
>
>
> ... and in the admin as:
>
> from cartridge.shop.admin import CategoryAdmin, ProductAdmin, 
> ProductVariation, ProductOption, Order
>
>
> ...
>
>
> class BaseProductAdmin(ProductAdmin):
> fieldsets = product_fieldsets
>
> additional_fieldsets = ("product_height", "product_width", 
> "product_projection", "product_diameter", "product_length",
> "cornice_picture", "cornice_profile_picture", 
> "cornice_wall_height",  "cornice_ceiling_projection",
> "cornice_pattern_repeat", "internal_height", 
> "internal_width", "priority",)
>
> fieldsets.append(
> (_("Additional"), {
> "fields": tuple(additional_fieldsets),
> }))
>
> list_display = product_list_display
> list_filter = ("status", "available", "categories", "product_type", 
> "updated")
>
> def has_module_permission(self, request):
> for (name, items) in settings.ADMIN_MENU_ORDER:
> if "stevensons_shop.BaseProduct" in items:
> return True
> return False
>
>
> admin.site.register(BaseProduct, BaseProductAdmin)
>
>
>
> This used to work fine in previous versions of the system (those installed
> directly from pip), however I wanted to take advantage of some of the fixes
> in newer versions.
>
> However this has had the adverse affect of breaking my admin area. Whereas
> before I could simply click on the "Base product" sidebar link and get
> taken to my admin view I now am immediately redirected to the generic
> /admin/shop/product view that only contains the basic information for my
> product and none of my extended fields, I'm aware that there have been some
> pretty major changes that happened in commit #8d3ac6b
> 
>  however
> I am currently at a loss trying to figure out what I need to do to get this
> working again.
>
> Any suggestions are greatly appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googl

[mezzanine-users] I have this on migration

2017-02-05 Thread marvel tales
Hello,

I run 
python manage.py makemigrations
python manage.py migrate  

I have this bug

Apply all migrations: admin, auth, blog, conf, contenttypes, core, 
django_comments, forms, galleries, generic, pages, redirects, sessions, 
sites, twitter
Running migrations:
  Applying blog.0003_auto_20170206_0116...Traceback (most recent call last):
  File 
"/home/aa/myproject/sd_appenv/lib/python3.5/site-packages/django/db/backends/utils.py",
 
line 64, in execute
return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: column "title_en" of relation 
"blog_blogcategory" already exists


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 14, in 
execute_from_command_line(sys.argv)
  File 
"/home/aa/myproject/sd_appenv/lib/python3.5/site-packages/django/core/management/__init__.py",
 
line 367, in execute_from_command_line
utility.execute()

Thank you very much in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.